Fikra API is built agent-native from the first endpoint. An agent can pay per call with x402, connect over MCP or A2A, use an API key, create an account for a human, or run the whole flow from a terminal. No browser session, no dashboard, no formal UI required.
| Mode | Endpoint | When to use it |
|---|---|---|
| x402 pay-per-call | POST /v1/chat/completions | No account. Receive a 402 quote, sign USDC on Base, retry. |
| API key | POST /v1/chat/completions | Normal human or agent account with a prepaid wallet. |
| MCP | POST /v1/mcp | MCP clients: fikra_chat, fikra_quote, fikra_list_models. |
| A2A | POST /v1/a2a | Agent-to-agent message/send over the A2A shape. |
| Agent-assisted account | POST /v1/agents/accounts | A terminal agent creates an account for a human, gets a 6-hour token, creates keys and tops up. |
No signup and no API key. Send a normal OpenAI-style body. The API returns HTTP 402 with a base64 PAYMENT-REQUIRED header. Sign the quote with any x402 client on Base, then retry with PAYMENT-SIGNATURE.
POST https://api.fikraapi.co.ke/v1/chat/completions
Content-Type: application/json
{"model":"deepseek-v4.1-flash","messages":[{"role":"user","content":"Hello"}]}
Pre-flight quote: POST /v1/agent/quote. The x402 flow is for machines that hold a wallet, not for humans with a card.
Every account operation has an HTTP endpoint. The repository ships a terminal client at agent_cli.py with signup, me, keys, balance, usage, topup, status and chat. Any agent runtime can call the same endpoints directly.
python agent_cli.py signup --email [email protected] --name my-agent
python agent_cli.py keys create --name laptop
python agent_cli.py topup --amount 20
python agent_cli.py balance
Fikra pins named DeepSeek checkpoints, so an ID does not silently move under you. Current pinned lines include deepseek-v4.1-flash, deepseek-v4.1-flash-1017 and deepseek-v4-flash-0731. On fresh input and output for V4.1 Flash we are the cheapest among the global gateways we track; on cache-heavy traffic some competitors have cheaper cached input. The full table is on the docs home.
Humans: authentication. Agents for humans: agents. Full agent docs: for-agents. Machine-readable: agents.json.