Python quickstart and examples for Fikra API - the OpenAI-compatible AI inference API built for African developers.
If you just need an AI chatbot for your business and don't want to host the code yourself, you do not need this repository.
Through our partnership with Lacesse Pages, you can instantly deploy a fully-hosted, custom AI agent in under 5 minutes directly from the Fikra Dashboard.
👉 Deploy a Hosted Bot on Fikra API
- Fikra Examples : Example use cases using Fikra API
Fikra API gives developers across East Africa and beyond access to powerful AI inference without the usual barriers - no Stripe account required, no $20 minimums, no VPN. Pay with M-Pesa and local payment apps. Start from KES 130. Get 2 million tokens per dollar.
This repo contains everything you need to get started in under 5 minutes.
| Model | Best for |
|---|---|
fikra-pro-120b |
Complex reasoning, long-form generation |
fikra-pro-20b |
Balanced, best for most use cases |
fikra-fast-8b |
Speed, multilingual, high-volume tasks |
fikra-nano-1b |
Edge deployment (coming soon) |
Create a free account at fikraapi.co.ke. You get 2 million free tokens on signup during the launch period - no card required.
Fikra API is fully OpenAI-compatible. No new SDK to install.
pip install openaiimport openai
client = openai.OpenAI(
base_url="https://api.fikraapi.co.ke/v1",
api_key="your_fikra_api_key"
)
response = client.chat.completions.create(
model="fikra-pro-20b",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Write a haiku about writing code."}
]
)
print(response.choices[0].message.content)That's it. If you were already using OpenAI, the only change is base_url.
| File | Description |
|---|---|
quickstart.py |
Basic inference — single request, single response |
streaming.py |
Streaming inference — chunks arrive in real time |
curl_examples.sh |
curl reference for all three models |
env_example.txt |
Environment variable setup |
If your existing code uses the OpenAI Python SDK, switching to Fikra API is a one-line change:
# Before
client = openai.OpenAI(api_key="sk-...")
# After — everything else stays the same
client = openai.OpenAI(
base_url="https://api.fikraapi.co.ke/v1",
api_key="your_fikra_api_key"
)All OpenAI SDK features work as expected: streaming, system prompts, temperature, max_tokens, and any language with an HTTP client.
| Tier | Limit |
|---|---|
| Free (unverified) | 30 requests/minute |
| Trusted (after first top-up) | 100 requests/minute |
- Website: fikraapi.co.ke
- Documentation: docs.fikraapi.co.ke
- Product Hunt: producthunt.com/posts/fikra-api
- Builder: James Miano on LinkedIn
- Built by: Roniki Systems · Nairobi, Kenya
Issues and PRs welcome. If you build something with Fikra API, open a PR to add it to the examples.
Built in Nairobi. Designed for developers in markets that mainstream AI platforms ignore.