What is Claude Code
Claude Code is Anthropic’s agentic coding tool for reading codebases, editing files, running commands, and integrating with development tools. This setup points Claude Code at Capriole AI through its gateway settings: the API endpoint, the auth token, and the model for each alias.
Prerequisites
Before you begin, make sure you have:
Installation
Install Claude Code with the official native installer:
Or install it with Homebrew:
Or install it with npm (Node.js 22 or later):
Verify the install:
Configuration
Model validation
Claude Code 2.1.304 passes a file-read, file-write, and final-answer check through Capriole AI with every model in Supported models, using the configuration below.
Create or update ~/.claude/settings.json:
What each setting does:
model is the default model for new sessions. A model you pick with /model is saved and used next time.
ANTHROPIC_BASE_URL sends requests to Capriole AI. Do not add /v1; Claude Code adds /v1/messages itself.
ANTHROPIC_AUTH_TOKEN sends your key as a Bearer token, which Capriole AI requires.
- The three
ANTHROPIC_DEFAULT_*_MODEL values point the opus, sonnet, and haiku aliases at models that Capriole AI serves. haiku is the model Claude Code uses for quick background work.
For a one-time shell setup, export the endpoint and token, then pass the model:
Run Claude Code
Start Claude Code from your project directory:
Switch models in a session with /model, for example /model opus for Opus 5.5. For a non-interactive run, use print mode:
Supported models
Claude Code uses the Anthropic Messages protocol, so it supports Capriole AI’s Claude models:
claude-fable-5-1 (Fable 5.1, the recommended default)
claude-opus-5-5 (Opus 5.5)
claude-fable-5
claude-opus-5
claude-opus-4-8
claude-opus-4-7
claude-opus-4-6
claude-sonnet-4-6
claude-latest, which always points to our latest Claude flagship (currently Fable 5.1)
Claude Code does not recognize claude-latest as a model name, so it assumes a 200K context window for it. Use a concrete ID such as claude-fable-5-1 to get the model’s full context window.
Troubleshooting
Why does Claude Code return an authentication error?
Use ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY. ANTHROPIC_API_KEY sends the key in an x-api-key header, and Capriole AI accepts only a Bearer token.
Why do requests fail with endpoint errors?
Confirm that ANTHROPIC_BASE_URL is https://api.caprioletech.com without /v1.
Why does Claude Code switch back to another model on every launch?
Remove ANTHROPIC_MODEL from your settings and shell. When it is set, Claude Code returns to that model on the next launch instead of the model you saved with /model.
Why does /model opus or /model sonnet fail?
Keep the three ANTHROPIC_DEFAULT_*_MODEL values. Without them, Claude Code sends Anthropic’s own alias targets. For example, sonnet requests claude-sonnet-5-5, which Capriole AI does not serve, and the request fails with Unsupported Claude Messages model.
Why doesn’t Claude Code use my effort level?
Claude Code saves the effort level separately for each model. Choose it with /effort while the model is active. A top-level effortLevel in your user settings does not apply to Opus 5.5.
Why does token counting fail?
Capriole AI forwards /v1/messages/count_tokens to the selected upstream. When that upstream does not support token counting, Claude Code estimates the count instead, and the session keeps working.
Notes
~/.claude/settings.json applies to your user account in every project. Replace YOUR_CAPRIOLE_AI_API_KEY with your Capriole AI API key.
- Gemini, Grok, GLM, and Kimi models do not run in Claude Code, because it speaks only the Anthropic Messages protocol. Use OpenCode, Kilo Code, or another multi-protocol agent for those models.
- Official references: Claude Code setup, model configuration, and LLM gateway configuration.
Last modified on October 20, 2026