Fikra API solutions · all how-tos

How to charge users for AI features inside your SaaS

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 inference API that lets you run chat models behind one endpoint and bill your own users for the AI features you ship. You send OpenAI-style chat-completions requests to https://api.fikraapi.co.ke/v1, metered in tokens, and pay Fikra in USD or KES from a token-credit wallet. Because pricing is per 1M tokens with a published per-model rate, you can turn each request's token usage into a per-user charge in your own product.

This page covers the server-side path only: your API key stays on your backend, never in client code.

Prerequisites

Step-by-step

  1. Store the key server-side. Set FIKRA_API_KEY in your backend environment (or secret manager). Do not ship it to browsers or mobile clients; your SaaS backend calls Fikra on the user's behalf.

  2. Create the client. Point the OpenAI SDK at Fikra's base URL:

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.fikraapi.co.ke/v1",
    api_key=os.environ["FIKRA_API_KEY"],
)
  1. Pick a model per feature tier. For high-volume, low-margin features, start with deepseek-v4-flash-0731 (the cheapest listed model). For heavier features, step up to deepseek-v4.1-flash or fikra-auto. This choice is the main lever on your per-user gross margin.

  2. Call chat completions.

response = client.chat.completions.create(
    model="deepseek-v4-flash-0731",
    messages=[
        {"role": "system", "content": "You are a helpful assistant inside a SaaS product."},
        {"role": "user", "content": "Summarise this customer's ticket."},
    ],
)

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

Streaming is supported if your UI needs it; the request and response shapes stay OpenAI-style.

  1. Meter the usage object. Read the token counts from response.usage on every call, multiply by the model's input/output rate, and record the amount against the calling user or plan. Charge your users in USD or KES in whatever billing system you already run.

  2. Respect the request rates. Limits are 30 requests/min for unverified accounts and 100 requests/min for trusted accounts. Queue or throttle per-tenant calls in your backend so one user's burst does not exhaust the budget for everyone.

  3. Fund the wallet. Fikra usage is drawn from a token-credit wallet topped up by M-Pesa or card via Paystack. Agents can also top up with x402 USDC on Base.

Verify it works

Send one short request with the snippet above and confirm:

If the key was copied with whitespace or belongs to a deactivated account, the call fails with 401; see Common errors.

Costs

All rates are USD per 1M tokens:

Model Input Output
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

Pricing starts at 0.09 USD per 1M input tokens and 0.15 USD per 1M output tokens. Your charge to an end user is your decision: divide the metered token cost by your markup to get the per-user price, then reconcile against your wallet balance. For anything not listed here, check the pricing page.

Common errors

usagestatusdashboard