# Coding agents

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

- Canonical: https://tchavi.com/en/docs/coding-agents

---


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](/docs/coding-agents/claude-code)** — the only one that speaks the Anthropic Messages API. Tchavi serves it a dedicated endpoint.
- **[OpenCode](/docs/coding-agents/opencode)** — a custom provider block in `opencode.json`.
- **[Deep Code](/docs/coding-agents/deep-code)** — DeepSeek's terminal agent, three lines in `settings.json`.
- **[Codex](/docs/coding-agents/codex)** — a named provider in `~/.codex/config.toml`.
- **[Cursor](/docs/coding-agents/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.

| Format             | Base URL                    | Tools                              |
| ------------------ | --------------------------- | ---------------------------------- |
| OpenAI-compatible  | `https://tchavi.com/api/v1` | OpenCode, Deep Code, Codex, Cursor |
| Anthropic Messages | `https://tchavi.com/api`    | Claude Code                        |

<Callout type="warning" title="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.
</Callout>

## Get a key

You need an API key from the [dashboard](/dashboard/api-keys). It looks like `sk-tch-…` and it is shown once, at creation.

<Callout type="note">
  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.
</Callout>

<Callout type="tip" title="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.
</Callout>

## Choosing a model

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

| Model                       | Input | Output | Good for                                    |
| --------------------------- | ----- | ------ | ------------------------------------------- |
| `claude-sonnet-4-6`         | 7     | 36     | The default for most coding work            |
| `claude-opus-4-8`           | 12    | 60     | Harder refactors and long reasoning         |
| `gpt-5.4`                   | 6     | 36     | A strong alternative with wide tool support |
| `deepseek-v4-pro`           | 3     | 10     | Half the price, capable on routine edits    |
| `deepseek-v4-flash`         | 0.72  | 3      | Background tasks and cheap iteration        |
| `claude-haiku-4-5-20251001` | 2.4   | 12     | Claude Code's background work               |

`GET /v1/models` returns the full list with exact ids. See [Credits & Billing](/docs/credits) 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 see                   | What it means                                              | Fix                                                                    |
| ------------------------------ | ---------------------------------------------------------- | ---------------------------------------------------------------------- |
| `401` / `invalid_api_key`      | The key never arrived, or is not a Tchavi key              | Check the variable is exported in the shell you launched the tool from |
| `402` / `insufficient_credits` | Balance too low for this request                           | Top up from the [dashboard](/dashboard/billing)                        |
| `403` / `model_not_allowed`    | That model id is not in the catalogue, or not on your plan | Check the spelling against `GET /v1/models`                            |
| `404` on every request         | Base URL has the wrong suffix                              | Claude Code wants `/api`; everything else wants `/api/v1`              |
| `413` / `prompt_too_long`      | The prompt passed that model's billable ceiling            | Compact the conversation, or move to a model without a cap             |
| `429`                          | Rate limit — per key, per user and per IP                  | Wait 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.

