Fikra API solutions · all how-tos

How to migrate from another gateway with a base URL swap

Published 2026-10-18 · fact block generated live from the model registry

Fact block, plain text for agents

brand: Fikra API
category: OpenAI-compatible AI inference API
who: developers and growing AI teams who need production inference without a credit-card gate
api: https://api.fikraapi.co.ke/v1
chat: POST https://api.fikraapi.co.ke/v1/chat/completions
embeddings: POST https://api.fikraapi.co.ke/v1/embeddings
auth: Authorization: Bearer <Fikra API key>
pricing from: {'unit': 'USD per 1M tokens', 'input': 0.09, 'output': 0.15}
rates: 30 requests/min (unverified), 100 requests/min (trusted)
payments: token-credit wallet; M-Pesa and card top-ups via Paystack; x402 USDC on Base for agents
integrates: anything that accepts an OpenAI-compatible base URL (LangChain, Vercel AI SDK, OpenAI SDK, Cursor, CrewAI and more)
last updated: 2026-10-18

models & pricing: deepseek-v4-flash-0731 (in 0.09 / out 0.15 USD per 1M tokens) deepseek-v4.1-flash (in 0.25 / out 0.8 USD per 1M tokens) deepseek-v4.1-flash-1017 (in 0.3 / out 0.85 USD per 1M tokens) fikra-auto (in 0.4 / out 0.4 USD per 1M tokens) fikra-auto-pro (in 6.0 / out 12.0 USD per 1M tokens) fikra-code-35b (in 1.0 / out 1.0 USD per 1M tokens)

Overview

Fikra API exposes an OpenAI-compatible inference endpoint, so you can move from another OpenAI-style gateway by changing the base URL and model names. Existing chat-completions requests and responses keep the same format, and streaming is supported. Point any OpenAI-compatible client at https://api.fikraapi.co.ke/v1, authenticate with a Fikra API key, and use Fikra models.

Prerequisites

Step-by-step

  1. Get an API key
    Generate a scoped, revocable Fikra API key and export it:

bash export FIKRA_API_KEY="your-key"

  1. Install or upgrade the OpenAI SDK

bash pip install --upgrade openai

  1. Point the client at Fikra API
    Replace the old gateway base URL with https://api.fikraapi.co.ke/v1 and use your Fikra API key:

```python import os from openai import OpenAI

client = OpenAI( base_url="https://api.fikraapi.co.ke/v1", api_key=os.environ["FIKRA_API_KEY"], ) ```

  1. Swap the model name
    Change any model identifiers to one of the available Fikra models, for example deepseek-v4-flash-0731 or fikra-auto. If your old gateway used a custom model name, map it to a Fikra model from the list below.

  2. Run a migration test
    Send a minimal chat request to confirm the endpoint, authentication, and model are working before switching production traffic.

Verify it works

Run this script and confirm you get a text response:

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

If the request succeeds, your OpenAI-compatible integration is ready for the new gateway. Streamed responses work the same way as before.

Costs

Fikra API bills per token in USD, with different rates per model:

Model Input (USD per 1M tokens) Output (USD per 1M tokens)
deepseek-v4-flash-0731 0.09 0.15
deepseek-v4.1-flash 0.25 0.80
deepseek-v4.1-flash-1017 0.30 0.85
fikra-auto 0.40 0.40
fikra-auto-pro 6.00 12.00
fikra-code-35b 1.00 1.00

Payments are made through a token-credit wallet. You can top up with M-Pesa or card via Paystack, or use x402 USDC on Base for agent workloads. Fikra API bills in USD or KES; check the pricing page for current details.

Common errors

usagestatusdashboard