ANTHROPIC_BASE_URL points at. Sail serves that API for
GLM-5.3 (system prompts, tool calling, and streaming included), so pointing
Claude Code at Sail is just environment configuration. The command below does
it in one step.
Want to keep Claude Code on its current model and send selected work to Sail
instead? Install the Sail plugin for coding agents.
Quickstart (terminal)
Install Claude Code if you haven’t, then launch it routed to Sail:claude on GLM-5.3. Nothing on your machine is modified: the
routing applies to that one session, so your Claude Code setup and your
Anthropic credentials are left alone. If you prefer not to store a key, set
SAIL_API_KEY in your environment and skip sail auth login.
Three commands, three scopes
You never need
sail claude on to use sail claude. Turning it on is only for
reaching the entry points you do not launch yourself, and sail claude keeps
working after you turn it off.
One exception to “every Claude Code”: routing set in a repository’s own
.claude/settings.json takes precedence over your user settings, so a session
started there keeps using that repository’s routing. Run
sail claude on --project inside such a repository to route it too.
Trusted workspaces (no permission prompts)
For trusted repos, containers, or VMs where you want long-running agent tasks without clicking through Claude Code permission prompts, use:--trusted launches Claude Code in bypass-permissions mode. This avoids Claude
Code’s auto-mode safety classifier path, so it also avoids failures like
safety classifier temporarily unavailable when Sail model requests are
otherwise healthy. Use it only where you are comfortable letting Claude Code run
tools without prompting.
This works inside a Sailbox too: Sail sets IS_SANDBOX=1 on
Sailbox commands by default, which Claude Code recognizes as a sandbox, so
bypass-permissions mode is allowed there even for root (the default user for
Sailbox commands when the image does not set one). Setting IS_SANDBOX
yourself on a command replaces the default for that command. A Sailbox created
before this marker existed gains it after an upgrade.
Pass flags through to claude after --:
VS Code extension
The VS Code extension isn’t launched from your shell, so it doesn’t receive per-invocation environment variables. Persist the routing instead:sail claude off removes only the keys sail claude on wrote. Settings that
changed while it was on, whether you changed them or Claude Code did, are kept.
Extension sessions read that env block, but the extension’s own pre-launch
login check does not. If you don’t have a saved Anthropic login, also add
the routing to VS Code’s user settings (Preferences: Open User Settings (JSON)) and reload the window. sail claude on prints this snippet:
sail claude on --project to scope
the routing to one repository. It writes your API key into
.claude/settings.local.json (Claude Code’s personal, not-shared project
file) and adds that file to .claude/.gitignore so it stays out of commits.
Claude Code applies project settings only after you trust the folder in its
first-run prompt.
Choosing models
GLM-5.3 is the default. The/model picker lists five Sail-hosted rows:
You can switch models in these ways:
- Mid-session: open
/modeland pick a row, or type/model <id>for any id in the table. The choice lasts for this session only: Sail pins the startup model, so the next launch starts on the configured main model again. Use the two options below to persist a different one. - At launch:
--model <id>starts on that model. Any id from the model catalog works, not only the five rows. A model outside the lineup is added to the picker for that session. - Persistently:
sail claude on --model <id>pins it for every Claude Code that reads your settings.
--background-model <id> changes that. Subagents use the main model either
way.
The table above shows the default rows. The rows are Claude Code’s opus,
sonnet, haiku, and fable model aliases plus one custom row, and Sail
points each one at a different Sail model. The main model always takes the
opus row, which the picker lists first, and the background model takes the
haiku row. The remaining Sail models fill the other rows, so no model appears
twice. For example, with --model moonshotai/Kimi-K3, Kimi K3 moves to the
first row and GLM-5.3 moves to the sonnet row.
sail claude and sail claude on write Claude Code’s availableModels setting
so fresh local sessions show only Sail-backed picker rows, with the main model
first so the picker’s Default row resolves to it. Claude Code concatenates
non-managed availableModels from user, project, local, and temporary settings,
though, so rows from another settings scope may still appear. Rows that name
non-Sail models (such as claude-* IDs) still route to Sail and will not be
served there. Remove them from the other settings file or enforce the picker
with managed settings. sail claude on prints a warning when it can see those
extra rows.
Choosing a completion window
Claude Code runs on Sail’s default completion window,asap, unless you choose another one. Lower-priced windows trade latency for
cost:
- Accepts
asaporbalanced. - Covers every request the session sends: the main model, background work, and subagents.
sail claude on --completion-window balancedpersists the window for every Claude Code that reads your settings, such as a bareclaudeor the VS Code extension. Runsail claude onwithout the flag to return to the default.sail claudesets each session up from its own flags, so a window saved withondoes not carry over. Pass--completion-windowtosail claudeas well.balancedsuits long agentic sessions: turns can take longer, at lower token prices. See Pricing.- The
/modelpicker listsasapprices whichever window you choose.
flex is unavailable in Claude Code because its Messages API requests wait for
each turn. Use balanced for lower-cost sessions. If an earlier setup saved
flex, run sail claude on --completion-window balanced to replace it, or
sail claude off to remove Sail routing.
The flag sets Claude Code’s ANTHROPIC_CUSTOM_HEADERS to
X-Sail-Completion-Window: <window>, the
header Sail reads a completion window from
when a request body names none.
Commit attribution
sail claude on sets Claude Code’s top-level attribution.commit to a Sail
co-author trailer naming the resolved model:
--model override names
that model in the trailer instead (so a non-default setup isn’t misattributed to
GLM-5.3). attribution.pr is emptied (no PR-body attribution line). sail claude off puts your original attribution back. This only affects the
persisted path: a plain sail claude session does not touch attribution.
Manual configuration
If you’d rather configure Claude Code yourself, set the routing environment by hand (sail claude env prints the full block, including picker display
metadata):
- Use the bare host. Claude Code appends
/v1/messagesitself. A/v1base URL would resolve to/v1/v1/messagesand return a 404. ANTHROPIC_AUTH_TOKENis what Sail expects. Sail also acceptsANTHROPIC_API_KEY, which Claude Code sends throughx-api-key. Set only one credential variable to avoid ambiguous client precedence.- Pin
ANTHROPIC_MODELand remap every alias. A saved/modelchoice (or a--resumed session) can otherwise start on an unmappedclaude-*model ID that Sail cannot serve. Each alias row can point at a different Sail model, which is how the five-row picker above is built: Claude Code offers four alias rows plus one custom row, and the_NAMEcompanions label them. - Pin
CLAUDE_CODE_SUBAGENT_MODEL. It’s the highest-priority subagent model source, so a value inherited from your shell or a settings file (e.g. aclaude-*ID left over from a prior Anthropic/Bedrock setup) would send every subagent to an unmapped model. Setting it to a Sail model routes all subagents onto GLM. - Declare
_SUPPORTED_CAPABILITIES. Claude Code enables effort levels and extended thinking by matching the model ID against known patterns. A custom ID likezai-org/GLM-5.3matches none, so/effortand thinking are silently disabled without the declaration. Sail maps both onto each model’s reasoning controls. The DeepSeek and Kimi rows also declarexhigh_effort. - Unset other providers’ variables. A provider selector such as
CLAUDE_CODE_USE_BEDROCKcomes beforeANTHROPIC_AUTH_TOKENin Claude Code’s credential precedence, so a leftover export would silently keep routing to that provider instead of Sail.ANTHROPIC_CUSTOM_HEADERSfrom a prior gateway setup would be sent to Sail on every request.sail claudestrips these automatically, and setsANTHROPIC_CUSTOM_HEADERSonly to the Sail completion window header when you pass--completion-window. By hand, theunsetline above does the same.
Limitations
- The native Claude Code desktop app reads endpoint routing only from
managed (administrator-distributed) configuration. It cannot be pointed at
Sail with environment variables or
settings.json. Use the terminal or the VS Code extension. - A signed-in Claude apps gateway session (an enterprise/corporate-SSO
deployment) is not part of the normal credential precedence and overrides
ANTHROPIC_AUTH_TOKEN, soclaudekeeps using the gateway and never sends requests to Sail. This only affects orgs running that gateway. Ordinary Pro/Max users don’t have one. If you do, run/logoutfirst, or launch that session withCLAUDE_CONFIG_DIRpointed at an empty directory (note: an isolated config dir won’t see your normal Claude Code settings/MCP servers). - An administrator-managed (MDM / policy)
availableModelsallowlist that excludes the Sail model takes precedence. Claude Code replaces the model at startup (with a warning), and a managed allowlist cannot be overridden because managed settings take precedence over the per-session settingssail claudeuses. That’s an enterprise policy. Raise it with your admin. (If you setavailableModelsyourself in your ownsettings.json, just include the Sail model id, e.g.zai-org/GLM-5.3, or drop the restriction.) - Sail is throughput-optimized. Long agentic turns can take longer than the
Anthropic API.
sail clauderaises Claude Code’s request timeout and disables its 5-minute stream-idle watchdog (on by default for custom base URLs) so a turn that queues before streaming isn’t aborted mid-flight. - Subagents run on the main Sail model by default:
sail claudepinsCLAUDE_CODE_SUBAGENT_MODEL, which overrides a subagent’s frontmattermodel:field. That makes custom subagents with aclaude-*frontmatter ID work (they route to the main model instead of failing), but it also means per-subagent model choices and--background-modeldon’t apply to subagents: they all use the main model. Override it yourself if you need a specific Sail model for subagents. - Background (haiku-tier) work runs on GLM-5.3-Flash by default rather than
the main model. Pass
--background-model zai-org/GLM-5.3to keep everything on one model.
Next steps
Models
Browse the catalog for alternative models.
Pricing
Per-token rates by model and completion window.
Completion windows
How the latency-for-price tradeoff works.
Support matrix
What the Anthropic-compatible API supports.
AI Quickstart
Give Claude Code Sail’s docs MCP and workflow skills, including
sail-migrate.
Sail for coding agents
Delegate scoped work or request a review from Sail.
Migrate to the Sail API
Move an existing app or agent to Sail.