Claude Code
Run Claude Code on Boundless models: install, the settings.json to edit, model ids for every slot, a verify command and common errors.
Claude Code talks to the gateway in the Anthropic Messages format. You point it at Boundless with a few environment variables in ~/.claude/settings.json, or let the one-command setup write them for you.
Claude Code is built for Anthropic's models, and there is no supported setting for another provider. This works by overriding the API it talks to. Your key replaces your claude.ai login for as long as the file sets it, and behaviour tuned to Anthropic's models can come out differently.
Choose your model#
Claude Code uses a main model for foreground work and a smaller one for background work. The settings below use deepseek/deepseek-v4.1-flash for the main slots and deepseek/deepseek-v4-flash-0731 for the background slot. Every model we serve is listed with its price and limits on the models page, and GET https://api.inference.boundless.network/v1/models returns the ids.
Laya, our System One model, cannot be Claude Code's model. Claude Code can call it before each tool call, though. System One has a hook that asks before a destructive command runs.
Install#
Install Claude Code from Anthropic's own documentation first. Then pick one way to point it at Boundless.
Run this in a terminal on macOS or Linux:
On Windows, or to skip the script, run the package yourself:
It signs you in through your browser, creates a key on your account and asks which harnesses to configure. Choose Claude Code. It backs up every file it changes and finishes with one small request per model and wire format.
- You can keep your Anthropic login: choose Anthropic account + Boundless, and
/modellists the Boundless models beside Anthropic's. It needs Claude Code 2.1.282 or later and is a preview on Linux and Windows. - Project scope keeps the key in
.boundless/api-key, ignored by git, and writes project-level configuration.
To put everything back the way it was before the first run:
Configure#
Claude Code#
Anthropic Messages format. Put the configuration in ~/.claude/settings.json so it applies everywhere. Exit Claude Code before changing this file; start a fresh session afterward.
- Use
ANTHROPIC_AUTH_TOKEN(sends asAuthorization: Bearer, works immediately) rather thanANTHROPIC_API_KEY(sends asx-api-key, requires interactive approval first). - Set every model slot. Claude Code can pick its saved model or a family model for foreground and background work.
- Claude Code 2.1.27x refuses model ids missing from its built-in catalog, which is every model here.
CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1restores the earlier behaviour of asking the API. - The credential replaces your claude.ai login while set. Remove it from
settings.jsonto go back. To keep the key out of the file, dropANTHROPIC_AUTH_TOKENand useapiKeyHelperinstead.
Model ids#
Set every model slot, as the settings above do. They give deepseek/deepseek-v4.1-flash to model, ANTHROPIC_MODEL and the Opus and Sonnet slots, and deepseek/deepseek-v4-flash-0731 to the Haiku slot. Use any id from GET https://api.inference.boundless.network/v1/models.
Verify#
Run the claude -p command from the setup above. The reply should report boundless.
To check the base URL and key on their own, list the models the gateway serves. A list of models means both are right. A 401 means the key is missing or wrong:
Let your agent do the setup#
To have a coding agent do the setup instead, point it at the setup guide: the same steps, written for an agent. Exit Claude Code first if it is the agent doing the work, because the new base URL applies to the next session.
Common errors#
| What you see | What it usually is |
|---|---|
401 on every request |
Wrong header. Use ANTHROPIC_AUTH_TOKEN, or switch between Authorization: Bearer and x-api-key. |
| An error naming a model you never chose | Claude Code is sending its default. Set every slot, including the background one. |
| Claude Code refuses the model id | Set CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT to 1, as in the settings above. |
Empty reply, stop_reason: max_tokens |
The output budget has to cover thinking too. Give reasoning models 1024+. |
403 with model_not_allowed |
Your team admin has not enabled that model for you. Ask them, or pick another. See Model access. |
Every status and code is on the Errors page. Other harnesses are on the Coding Agents & Harnesses page.