Pay for an AI API with M-Pesa

How to fund a Fikra API wallet with M-Pesa, from top-up to the KES charge and the first call.

Problem

What this solves.

M-Pesa pays in KES. Fikra quotes model prices in USD per 1M tokens, so the checkout shows the exact KES amount before you confirm.

Steps

Do this in order.

  1. Create an account. A direct signup starts with $0.50 in credit.
  2. Open the dashboard and choose top up.
  3. Enter an amount from $1.00. The checkout shows the KES charge at KES 133 = $1.
  4. Approve the M-Pesa prompt. The wallet is credited in USD.
  5. Copy an API key and call the OpenAI-compatible endpoint.
Quickstart

Copy the snippet.

from openai import OpenAI

client = OpenAI(base_url="https://api.fikraapi.co.ke/v1", api_key="fk_...")

response = client.chat.completions.create(
    model="deepseek-v4-1-flash-economy-free",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

Base URL: https://api.fikraapi.co.ke/v1. Default model: deepseek-v4-1-flash-economy-free.

Get a free key

Troubleshooting

Common errors.

  • 401: the key is missing or inactive. Create a new key in the dashboard.
  • 402: the wallet is empty. Top up from $1.00.
  • 429: the account hit its rate limit. Wait and retry with backoff.
  • 503: the upstream route is temporarily unavailable. Retry.

Start free. Pay only for what you use.

Top up from $1.00. No subscription.

Get a free key