Fikra API solutions · all how-tos

Switch a CrewAI or LangChain Agent to 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

Fikra API is an OpenAI-compatible AI inference API for developers and growing AI teams. Because it exposes the same chat-completions request and response format as OpenAI, with streaming support, you can point CrewAI, LangChain, or any tool that accepts an OpenAI-compatible base URL at Fikra API without rewriting your agent logic. All calls go through one endpoint: https://api.fikraapi.co.ke/v1.

Prerequisites

Step-by-step

  1. Set the OpenAI-compatible base URL in your agent configuration to: https://api.fikraapi.co.ke/v1
  2. Set your Fikra API key as the bearer token. In code, read it from the FIKRA_API_KEY environment variable.
  3. Choose a model from the Fikra model list, for example deepseek-v4-flash-0731.
  4. Keep the standard chat-completion parameters you already use. Fikra API understands the same messages, roles, and streaming flags.
  5. If your agent also uses embeddings, call the embeddings endpoint at https://api.fikraapi.co.ke/v1/embeddings with the same Authorization: Bearer <Fikra API key> header.
  6. Save your changes and restart the agent using the new base URL.

Verify it works

Run a small chat completion with the OpenAI SDK to confirm the gateway is reachable:

import os
from openai import OpenAI

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

response = client.chat.completions.create(
    model="deepseek-v4-flash-0731",
    messages=[
        {"role": "user", "content": "Hello, Fikra!"}
    ]
)

print(response.choices[0].message.content)

If this returns a completion, your agent can now use the same endpoint.

Costs

Fikra API bills per model in USD per 1M tokens. The available models and prices are:

Model Input (USD/1M tokens) Output (USD/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 from a token-credit wallet, with M-Pesa and card top-ups via Paystack, plus x402 USDC on Base for agent payments. For pricing not listed here, check the pricing page.

Common errors

usagestatusdashboard