HyphenHyphen
HomeConsole
  • Get Started
  • Connect your coding agent
  • Build with Hyphen
  • Chat UIs & automation
  • Recipes
  • Guides
  • API Reference
Claude CodeCodex CLIAiderZedKilo CodeOpenHandsGooseHermes agentOpenClawOther clients
powered by Zudoku
Connect your coding agent

Claude Code

Claude Code speaks the Anthropic Messages API. Hyphen serves that API at /v1/messages, so Claude Code can talk to the gateway — once you map its model tiers to Hyphen models. That mapping is required; skip it and every request fails. The copy-paste block below does the whole thing.

The /v1/messages surface is verified live, including tool calling and streaming. This settings.json block comes from Claude Code's official documentation and has not been run end to end. Corrections to support@hyphen-solution.com.

1. Get a key

app.hyphen-solution.com → sign in → pick a plan or credit pack → Dashboard → API Keys. Copy the sk-... key.

2. Configure — one copy-paste block

Create or edit ~/.claude/settings.json and paste this. Replace the token with your key; leave the model mappings as-is.

Code
{ "env": { "ANTHROPIC_BASE_URL": "https://api.hyphen-solution.com", "ANTHROPIC_AUTH_TOKEN": "sk-YOUR_KEY", "ANTHROPIC_DEFAULT_SONNET_MODEL": "minimax-m3", "ANTHROPIC_DEFAULT_OPUS_MODEL": "minimax-m3", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "minimax-m2.5" } }

That's the entire setup. Restart Claude Code so it re-reads the file, then jump to Verify.

Prefer shell exports?

The same config as environment variables — add to ~/.zshrc or ~/.bashrc:

TerminalCode
export ANTHROPIC_BASE_URL="https://api.hyphen-solution.com" export ANTHROPIC_AUTH_TOKEN="sk-YOUR_KEY" export ANTHROPIC_DEFAULT_SONNET_MODEL="minimax-m3" export ANTHROPIC_DEFAULT_OPUS_MODEL="minimax-m3" export ANTHROPIC_DEFAULT_HAIKU_MODEL="minimax-m2.5"

Then source ~/.zshrc (or open a new terminal) and run claude.

Why the model mappings are required

This is the detail that breaks setups, so it's worth 30 seconds.

Claude Code doesn't send a model name like minimax-m3. It sends its own default model names (claude-sonnet-4-..., claude-opus-4-..., claude-haiku-...) — the names of the models it was built to talk to. The Hyphen gateway only accepts the real model IDs in its catalog; sending anything else returns:

Code
{ "error": { "message": "Invalid model name", "type": "invalid_request_error" } }

So pointing only ANTHROPIC_BASE_URL at Hyphen is not enough — every request 400s on the model name. The ANTHROPIC_DEFAULT_*_MODEL variables fix this: they tell Claude Code to substitute a real catalog model wherever it would otherwise send one of its default names.

Code
Claude Code wants "claude-sonnet-4" ──▶ sends "minimax-m3" instead (SONNET → minimax-m3) Claude Code wants "claude-opus-4" ──▶ sends "minimax-m3" instead (OPUS → minimax-m3) Claude Code wants "claude-haiku" ──▶ sends "minimax-m2.5" instead (HAIKU → minimax-m2.5)

We map both the Sonnet and Opus tiers to minimax-m3 (the flagship — the newest M-series generation) so heavy agent work always lands on it, and the Haiku tier — Claude Code's lightweight background tier — to minimax-m2.5 (the fast tier) to keep those calls cheap.

Want a lighter, cheaper default?

Map the Sonnet tier to minimax-m2.7 (balanced) instead — day-to-day work gets cheaper, and you can still call the flagship on demand:

Code
"ANTHROPIC_DEFAULT_SONNET_MODEL": "minimax-m2.7", "ANTHROPIC_DEFAULT_OPUS_MODEL": "minimax-m3", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "minimax-m2.5"

3. Verify

TerminalCode
claude -p "Reply with the single word: connected"

If it prints connected, Claude Code is wired to the gateway and the model mapping is working. (A 400 Invalid model name here means the ANTHROPIC_DEFAULT_*_MODEL variables aren't being read — see below.)

Troubleshooting

  • 400 Invalid model name — the model mappings aren't taking effect. Confirm ~/.claude/settings.json is valid JSON (no trailing commas) and that you restarted Claude Code. If you used shell exports, make sure the current terminal actually has them (echo $ANTHROPIC_DEFAULT_SONNET_MODEL).
  • 401 Invalid API key — the sk-... token is wrong or unset. Re-copy it from the console and check ANTHROPIC_AUTH_TOKEN.
  • 429 — your monthly budget is spent. Claude Code surfaces the reset date; see Rate limits & caps.
  • Env var names changed? Flag and env names can shift between Claude Code releases. If a variable seems ignored, check claude --help for the current names in your installed version.
  • Settings not applied at all — Claude Code reads ~/.claude/settings.json on startup. Fully quit and relaunch; delete and recreate the file if a stale copy is being picked up.
Last modified on July 28, 2026
Codex CLI
On this page
  • 1. Get a key
  • 2. Configure — one copy-paste block
    • Prefer shell exports?
  • Why the model mappings are required
    • Want a lighter, cheaper default?
  • 3. Verify
  • Troubleshooting
JSON
JSON
JSON