Fikra API solutions · all how-tos

Proxy an OpenAI-Compatible Endpoint for a Mobile Money Business with Fikra API

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

This guide shows developers how to expose a simple OpenAI‑compatible endpoint that forwards requests to Fikra API. The proxy can be used by a mobile‑money business to run chat models without dealing with credit‑card gates.

Prerequisites

Step‑by‑step

  1. Install dependencies bash pip install openai fastapi uvicorn
  2. Create a proxy server (example using FastAPI). The server receives OpenAI‑style chat requests at /v1/chat/completions and forwards them to Fikra API. ```python import os from fastapi import FastAPI, Request, HTTPException import openai

app = FastAPI()

# Configure OpenAI SDK to talk to Fikra API openai.api_key = os.getenv("FIKRA_API_KEY") openai.base_url = "https://api.fikraapi.co.ke/v1"

@app.post("/v1/chat/completions") async def proxy_chat(request: Request): payload = await request.json() try: response = openai.ChatCompletion.create( model="deepseek-v4-flash-0731", # any model from the fact block **payload ) return response except openai.error.OpenAIError as e: # Re‑raise as HTTP error so the client sees the same status code raise HTTPException(status_code=e.http_status, detail=str(e)) 3. **Run the server**bash uvicorn your_module:app --host 0.0.0.0 --port 8000 `` The proxy is now reachable athttp://:8000/v1/chat/completions`.

Verify it works

Send a test request to the proxy (replace <host> as needed):

curl -X POST http://<host>:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"Hello"}],"max_tokens":50}'

You should receive a JSON response identical to a direct Fikra API chat completion.

Costs

Usage is billed per token. The default rates are $0.09 USD per 1M input tokens and $0.15 USD per 1M output tokens. Specific models have their own rates (e.g., deepseek-v4-flash-0731 uses the default rates, fikra-auto-pro costs $6 USD input / $12 USD output per 1M tokens). See the pricing section of the API docs for the full list.

Common errors

usagestatusdashboard