Quickstart
1 — Get an API key
Section titled “1 — Get an API key”From the dashboard (Settings → API keys) or the CLI:
koda login --url https://your-gateway.example.com --token <your-org-token>koda keys create --scopes agent:run,wallet:read # prints a key — store it onceKeys authenticate as Authorization: Bearer <key> and carry scopes (agent:run, wallet:read, keys:manage,
metrics:read). Browser sessions use a sealed cookie instead.
2 — Fund the wallet
Section titled “2 — Fund the wallet”Usage is prepaid; top up on a local rail (card / USSD / OPay / PalmPay / M-Pesa / MoMo / …):
koda topup 5000 # ₦5,000 — returns a checkout URL / USSD code; credited on provider confirmationkoda wallet # balance + recent ledger3 — Run your first task
Section titled “3 — Run your first task”Three equivalent ways:
# CLIkoda run "add a null check to parseUser()" --file src/user.ts// SDK (streaming)import { KodaClient } from '@koda-rising/sdk';const koda = new KodaClient(BASE_URL, TOKEN);for await (const ev of koda.agentRun('add a null check to parseUser()', [{ path: 'src/user.ts', content }])) { if (ev.edits) applyEdits(ev.edits); if (ev.summary) console.log(ev.summary, `cost=${ev.costMinor}`);}# Raw HTTP (SSE)curl -N https://your-gateway/agent/run -H "authorization: Bearer $KODA_TOKEN" \ -H 'content-type: application/json' -d '{"prompt":"add a null check"}'4 — (optional) Index your repo, then chat
Section titled “4 — (optional) Index your repo, then chat”koda repo index src/**/*.ts # embeds files; the agent retrieves them automatically (vector mode)Chat threads stream token-by-token — see POST /chat/threads/:id/messages in the API reference.
Next: Concepts.