FIKRA API
Agent-assisted accounts

Any AI agent can create an account for a human, then use the whole API.

ChatGPT, Codex, Claude Code, Cursor, custom agents and bots can create a provisional Fikra API account for a human, create API keys, call chat completions, read usage, check balance and top up. The agent gets a 6-hour delegated token. A claim link lets the human turn the account into a full account they control.

No signup credit on agent-created accounts. The agent must top up before chat works. This is deliberate, to stop credit farming and unsolicited accounts.

1. Create the provisional account

curl -X POST https://api.fikraapi.co.ke/v1/agents/accounts \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "[email protected]",
    "agent_name": "my-agent",
    "agent_version": "1.0",
    "idempotency_key": "one-per-request"
  }'

The response contains account_id, a 6-hour token, and a claim_url. Give the claim URL to the human. Do not email it yourself unless the human asked you to.

2. Use the delegated token

Authorization: Bearer <agent token>

Scopes: keys:read, keys:write, chat:write, usage:read, balance:read, topup:link, topup:charge.

EndpointWhat it does
GET /v1/agents/meAccount, scopes, balance and token expiry
POST /v1/agents/keysCreate an API key, returned once
GET /v1/agents/keysList keys without secrets
POST /v1/agents/keys/{id}/revokeRevoke a key
GET /v1/agents/balanceWallet balance
GET /v1/agents/usageRecent usage and totals
POST /v1/agents/topupCheckout link, or saved-card charge with auto: true
GET /v1/agents/topup/{reference}Payment status
POST /v1/agents/token/refreshNew 6-hour token after the human claims the account

For chat, create an API key and call POST /v1/chat/completions exactly like a normal Fikra key.

3. Payments

Agents never handle card numbers. Two safe modes:

Auto-recharge is not available to agents. It is a human dashboard setting. No card data is ever stored in Fikra logs or returned to the agent.

4. The human claim link

The agent sends the claim_url to the human. The human sets a password and the account becomes a normal full account. The link is valid for 30 days. The agent token still expires after 6 hours; after a claim, the agent can call POST /v1/agents/token/refresh.

If the human never claims, the account stays dormant with zero balance. Top-ups made before a claim remain on that account and can be claimed with the same link.

5. Safety rules

Machine-readable spec: /agents.json. Questions: [email protected].