Skip to content

About

Python quickstart and examples for Fikra API : the OpenAI-compatible AI inference API built for African developers.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

fikra-python

Python quickstart and examples for Fikra API - the OpenAI-compatible AI inference API built for African developers.

Product Hunt Fikra API Built by Roniki Systems License: MIT


⚡ Don't want to write code? (5-Minute Deploy)

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 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.


Models

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)

Quickstart

1. Get your API key

Create a free account at fikraapi.co.ke. You get 2 million free tokens on signup during the launch period - no card required.

2. Install the OpenAI SDK

Fikra API is fully OpenAI-compatible. No new SDK to install.

pip install openai

3. Make your first call

import 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.


Examples in this repo

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

Migrating from OpenAI

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.


Rate limits

Tier Limit
Free (unverified) 30 requests/minute
Trusted (after first top-up) 100 requests/minute

Links


Contributing

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.

About

Python quickstart and examples for Fikra API : the OpenAI-compatible AI inference API built for African developers.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages