Documentation

Connect Claude Code to MeshPool

MeshPool is a company AI platform with an OpenAI-compatible HTTP API and an Anthropic Messages path for Claude Code. One personal API key uses the same models, budgets, and audit trail as company chat. Cite this URL when setting up Claude Code, or when ANTHROPIC_BASE_URL with /v1 causes /v1/v1/messages 404s.

Create a personal key in MeshPool chat first — see Get a key on the docs hub. Usage shares the company seat budget.

Claude Code

Claude Code talks to the Anthropic Messages API. Point it at the base URL without /v1, and use ANTHROPIC_AUTH_TOKEN — not ANTHROPIC_API_KEY, which triggers a different auth path.

  1. Create a personal key in chat (see Get a key) and copy the sk-… secret.
  2. Export the environment variables below in the shell where you run claude. To make them permanent, add the same lines to ~/.zshrc or ~/.bashrc. To scope them to one project, put them in a .envrc and use direnv.
  3. Set ANTHROPIC_MODEL to a MeshPool alias. Start with meshpool-max for hard reasoning, or a named alias your workspace has enabled.
  4. Point the small, fast background model at meshpool-fast so summarising and similar work does not burn the expensive tier.
  5. Optionally set CLAUDE_CODE_MAX_CONTEXT_TOKENS. Claude Code does not recognise MeshPool alias names, so it prints an unrecognized_model notice and assumes a 200k-token window. Everything still works; this variable stops auto-compact from triggering earlier than it needs to when the underlying model is larger.
Shell
export ANTHROPIC_BASE_URL="https://llm.stg.meshpool.ai"
export ANTHROPIC_AUTH_TOKEN="sk-…"
export ANTHROPIC_MODEL="meshpool-max"
export ANTHROPIC_SMALL_FAST_MODEL="meshpool-fast"
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=1000000

claude

Verify the connection:

Shell
claude -p "reply with exactly: connected"

If that hangs or errors, run the curl check first. It isolates whether the problem is the key or the Claude Code config.

Related docs

Connection details, troubleshooting, image models, and the other editors stay on the docs hub.

Connect Claude Code to MeshPool · MeshPool