How-to

Track Spend per API Key in the Dashboard

Last updated 2026-11-25. Facts are checked against the live registry.

Overview

Fikra API issues scoped, revocable API keys. Every request to the OpenAI-compatible endpoint uses Authorization: Bearer <Fikra API key>, and all token usage is drawn from your token-credit wallet.

To track spend per API key, give each project, environment, or agent its own key. The dashboard then shows spending attributed to each key.

Prerequisites

  • A Fikra API account with a token-credit wallet balance.
  • At least one Fikra API key. Keys are scoped, revocable, and never shared between users.
  • Top-up method ready: M-Pesa or card via Paystack, or x402 USDC on Base for agents.

Step-by-step

  1. In the Fikra API dashboard, create a separate API key for each project, environment, or application you want to track.
  2. Assign each key the appropriate scope for the models and endpoints it should use.
  3. Use that key in the relevant client or agent. Requests go to https://api.fikraapi.co.ke/v1 and include: Authorization: Bearer <Fikra API key>
  4. Keep API keys server-side; do not embed them in client-side code or docs examples.
  5. Monitor the dashboard’s spend view to see token usage and wallet deductions per key.
  6. Revoke any key that is no longer needed to stop further spend against it.

Verify it works

Send one chat completion with a key you want to track:

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": "ping"}],
)
print(response.choices[0].message.content)

After the request succeeds, check the dashboard for the spend activity against that API key. Usage is billed from your token-credit wallet.

Costs

Token prices are listed per 1M tokens in USD:

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
deepseek-v4.1-flash-1017 0.40 0.40
deepseek-v4.1-flash-1017 6.00 12.00
deepseek-v4.1-flash-1017 1.00 1.00

Check the pricing page for the latest rates.

Common errors

  • 401: Bad or inactive API key. Confirm the key is active and sent as Authorization: Bearer <Fikra API key>.
  • 400: Unsupported model. Use a model from the available Fikra API model list.
  • 429: Rate limit exceeded. Unverified keys get 30 requests/min; trusted keys get 100 requests/min. Retry after a short backoff.
  • 503: Upstream service busy. Retry with exponential backoff.

Per-key spend lives in the dashboard, and the LLM cost calculator shows what each model costs at your volume before you switch.

Live prices -> · Agent account -> · SDKs ->