Point Claude Code at OpenDunes to use any available model billed in DA.
Not yet available. Native Claude Code support needs the Anthropic Messages API, which OpenDunes does not expose yet — today, use an OpenAI-compatible coding agent (Codex CLI, OpenCode, Cursor) or call Anthropic models through the chat completions API.
Claude Code is Anthropic's official CLI agent for AI-assisted software development. It calls Anthropic's API directly and supports custom base URLs — so once OpenDunes exposes the Messages endpoint, routing it through OpenDunes and billing usage in Algerian Dinars will be a two-variable change.
Once the Messages endpoint ships, the setup will be the two environment variables Claude Code reads:
Claude Code reads ANTHROPIC_BASE_URL and uses it instead of api.anthropic.com. From that point on, every model call will go through OpenDunes and be billed to your DA balance.
Note. Claude Code speaks Anthropic's native Messages API format, not the OpenAI-compatible format. OpenDunes does not expose a Messages endpoint yet, which is exactly why this page is not live — the base URL override alone is not enough today.
When the integration is live, add the exports to your shell profile so they apply to every session:
Or set them per-project using a .env file and a tool like direnv:
Claude Code defaults to the latest Claude model. Specify a different one with --model:
Use a model slug from the OpenDunes catalog. Any model tagged with tools capability works with Claude Code's agentic loop.
Once live, a one-liner will confirm the wiring:
You should see a response streamed back. Check X-Balance-Available in the debug output (pass --debug) to confirm requests are reaching OpenDunes and your DA balance is being debited.
Claude Code usage billed through OpenDunes will appear in Dashboard → Analytics broken down by model, token count, and DA cost. Set a per-key budget cap in Dashboard → Keys to prevent runaway agentic sessions from draining your balance.
| Symptom | Likely cause | Fix |
|---|---|---|
401 invalid_api_key | Wrong key or env var not exported | Re-export ANTHROPIC_API_KEY in the current shell |
404 model_not_found | Slug format mismatch | Use provider/model format, e.g. anthropic/claude-sonnet-5 |
402 insufficient_credits | Balance too low | Top up DA at Dashboard → Billing |
| Responses are slow to start | Cold-start on the underlying provider | Normal; add --timeout flag if you need a higher client timeout |