SDKs

Quote, stream, receipt, budget. From code.

Minimal Python and TypeScript clients for the agent account. They cover models, quotes, streaming chat, receipts, agent account creation and per-key budgets. The SDKs live in the repository under sdk/; they are not on PyPI or npm yet. Prices and model IDs as of 2026-11-14.

PythonTypeScriptStreamingBudgetsReceipts

Python

pip install -e sdk/python
from fikra import Fikra client = Fikra(api_key="fk_...") q = client.quote(model="deepseek-v4.1-flash-1017", messages=[{"role":"user","content":"Hello"}], max_tokens=512) for chunk in client.chat(model="deepseek-v4.1-flash-1017", messages=[{"role":"user","content":"Hello"}], max_tokens=512, quote_id=q["quote_id"], stream=True): if chunk["type"] == "text": print(chunk["text"], end="") if chunk["type"] == "receipt": print(chunk)

TypeScript

npm install && npm run build
import { Fikra } from "fikra-api"; const client = new Fikra({ apiKey: process.env.FIKRA_API_KEY }); const q = await client.quote({ model: "deepseek-v4.1-flash-1017", messages: [{ role: "user", content: "Hello" }], max_tokens: 512 }); for await (const chunk of client.stream({ model: "deepseek-v4.1-flash-1017", messages: [{ role: "user", content: "Hello" }], max_tokens: 512, quote_id: q.quote_id })) { if (chunk.type === "text") process.stdout.write(chunk.text ?? ""); }
Agent budgets

Set a cap on the key the agent uses.

The existing key caps are enforced in code. Create a key with a daily or monthly cap, or update it later.

# Python key = client.create_key(agent_token, name="worker", daily_cap_usd=5, monthly_cap_usd=50) client.set_budget(agent_token, key["id"], daily_cap_usd=10)
// TypeScript const key = await client.createKey(agentToken, { name: "worker", daily_cap_usd: 5, monthly_cap_usd: 50 }); await client.setBudget(agentToken, key.id, { daily_cap_usd: 10 });
Scope today: budgets are enforced per API key. A key over its cap gets HTTP 402 until the cap is raised or the window resets. x402 calls are individually priced and paid per request.

Related: pricing · setup guides · agent account · public stats · create an account · support · status. Operated by Lacesse Ventures. No contractual SLA on the self-serve plan.

Receipts

Reconcile quote and actual.

The streaming response emits a final receipt event. The same receipt is available at GET /v1/agent/receipts/{id}.

curl https://api.fikraapi.co.ke/v1/agent/receipts/<receipt_id>

Receipts carry model, usage, quoted USD, actual cost and provider cost. They do not contain prompt or response bodies.