Fikra API & Developer Documentation

Direct, programmatic REST API access to all Fikra AI and Ternary Weight models. Build autonomous agents, power SaaS applications, and integrate Swahili-fluent AI into your workflows in minutes.

API Overview & Architecture

The Fikra API is a standard RESTful interface designed to be an immediate drop-in replacement for OpenAI or Anthropic APIs. If you know how to build with global AI APIs, you already know how to build with Lacesse.

Core Endpoints & Code Examples

Interact with the /v1/chat/completions endpoint to generate text, parse data, or simulate conversational memory. The API accepts standard JSON payloads.

cURL Example

curl -X POST "https://api.lacesse.co.ke/v1/chat/completions" \
  -H "Authorization: Bearer YOUR_LACESSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "fikra-7b-instruct",
    "messages": [
      {"role": "system", "content": "You are a helpful business assistant."},
      {"role": "user", "content": "How do I optimize my M-Pesa till flow?"}
    ],
    "temperature": 0.5,
    "max_tokens": 512
  }'
    

Python SDK Example

import os
from lacesse import FikraClient

client = FikraClient(api_key=os.environ.get("LACESSE_API_KEY"))

response = client.chat.completions.create(
    model="fikra-ternary-v1",
    messages=[{"role": "user", "content": "Jambo, how can I automate my inventory?"}]
)

print(response.choices[0].message.content)
    

Developer Integration Tutorials

Move from sandbox to production quickly with our official guides and open-source boilerplates.

Developer FAQ & Troubleshooting

Common questions regarding API keys, limits, and integration workflows.

How do I get a Fikra API key?

Simply sign up at the Lacesse Developer Portal. Once your email is verified, you can generate your API key instantly. The first $5 in API credits are free for sandbox testing.

Is the Fikra API compatible with OpenAI's format?

Yes. The Fikra API routes, payload structures, and JSON responses are designed to be a 1:1 drop-in replacement for the OpenAI API. You can switch to Fikra simply by changing the base URL and API key in your existing codebase.

Do you have SDKs for Python and JavaScript?

Yes. We maintain official, open-source SDKs for both Python (available via pip) and JavaScript/TypeScript (available via npm). Documentation for both can be found in our GitHub repositories.

What are the rate limits on the API?

Free tier (sandbox) keys are limited to 60 Requests Per Minute (RPM) and 10,000 Tokens Per Minute (TPM). Production tier accounts automatically scale to handle enterprise traffic, with custom limits available upon request.

Can I use the API to build WhatsApp bots?

Absolutely. Fikra's low latency and native Swahili NLP make it the perfect backend engine for WhatsApp Business bots. We provide webhook boilerplates to get your WhatsApp integration running in under an hour.

Is my API data stored or used for training?

No. Lacesse enforces a strict zero-data-retention policy for API payloads. Your prompts and completions are never logged, stored, or utilized to train future AI models, ensuring complete enterprise security.

What is the maximum context window supported?

The standard Fikra-7B-Instruct model supports a context window of 32,000 tokens, allowing you to pass extensive conversation histories, codebases, or multiple documents in a single API call.

How does Fikra API pricing compare to global alternatives?

Fikra is engineered for African market economics. At roughly $0.002 per 1,000 tokens, it is significantly cheaper than global competitors, while offering superior localization and offline edge options.