Coding agents

Run Claude Code, OpenCode, Deep Code, Codex or Cursor on Tchavi credits, paid with mobile money.

Every terminal coding agent talks to a model over HTTP, and each one lets you change the address it talks to. Point it at Tchavi and your agent runs on Tchavi credits — topped up with mobile money — instead of a card your bank may not let you use.

Pick your tool below. Each guide is self-contained: base URL, key, models, and what that particular tool loses behind a gateway.

The five guides

  • Claude Code — the only one that speaks the Anthropic Messages API. Tchavi serves it a dedicated endpoint.
  • OpenCode — a custom provider block in opencode.json.
  • Deep Code — DeepSeek's terminal agent, three lines in settings.json.
  • Codex — a named provider in ~/.codex/config.toml.
  • Cursor — the editor's own key path, with real limits.

Pick the right base URL

Tchavi speaks two request formats, and which one you use depends only on the tool.

FormatBase URLTools
OpenAI-compatiblehttps://tchavi.com/api/v1OpenCode, Deep Code, Codex, Cursor
Anthropic Messageshttps://tchavi.com/apiClaude Code

The two URLs differ by more than the suffix

Claude Code appends /v1/messages to whatever you give it, so its base URL stops at /api. Every other tool wants the /v1 included. Pasting the wrong one produces a 404 that looks like an outage.

Get a key

You need an API key from the dashboard. It looks like sk-tch-… and it is shown once, at creation.

Keys go in environment variables or a settings file outside your repository — never in a file you commit. Several of these tools read a project-level config that is easy to commit by accident; each guide says where the safe location is.

One key per agent

An agent loops on its own, and a misconfigured one can work through a balance faster than you would expect. Keep a separate API key for each tool, so the request log tells you which one spent what — and so revoking one does not interrupt the others.

Choosing a model

Any tool-capable chat model in the catalogue works with any of these agents. A few that suit agent workloads, with their credit cost per 1K input tokens:

ModelInputOutputGood for
claude-sonnet-4-6736The default for most coding work
claude-opus-4-81260Harder refactors and long reasoning
gpt-5.4636A strong alternative with wide tool support
deepseek-v4-pro310Half the price, capable on routine edits
deepseek-v4-flash0.723Background tasks and cheap iteration
claude-haiku-4-5-202510012.412Claude Code's background work

GET /v1/models returns the full list with exact ids. See Credits & Billing for how a credit converts to FCFA.

When something fails

Errors from Tchavi carry the same shape on both formats, so the code tells you what to do.

What you seeWhat it meansFix
401 / invalid_api_keyThe key never arrived, or is not a Tchavi keyCheck the variable is exported in the shell you launched the tool from
402 / insufficient_creditsBalance too low for this requestTop up from the dashboard
403 / model_not_allowedThat model id is not in the catalogue, or not on your planCheck the spelling against GET /v1/models
404 on every requestBase URL has the wrong suffixClaude Code wants /api; everything else wants /api/v1
413 / prompt_too_longThe prompt passed that model's billable ceilingCompact the conversation, or move to a model without a cap
429Rate limit — per key, per user and per IPWait for the Retry-After seconds; the tools retry by themselves

To see what the tool actually sent, open Usage in the dashboard: every request is logged with its model, token counts and credits charged, and you can open any single one.

On this page