Claude Code
Use Cortecs models with Claude Code
Claude Code is Anthropic's terminal-based coding agent. Connect it to Cortecs through the Anthropic-compatible Messages API.
1. Install Claude Code
On macOS, Linux, or WSL:
curl -fsSL https://claude.ai/install.sh | bashSee the Claude Code setup guide for other platforms.
2. Connect to Cortecs
Set the following variables in the terminal where you will run Claude Code:
export ANTHROPIC_BASE_URL="https://api.cortecs.ai"
export ANTHROPIC_AUTH_TOKEN="<API_KEY>"
unset ANTHROPIC_API_KEY
export ANTHROPIC_MODEL="<MODEL_ID>"
export ANTHROPIC_DEFAULT_OPUS_MODEL="<MODEL_ID>"
export ANTHROPIC_DEFAULT_SONNET_MODEL="<MODEL_ID>"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="<MODEL_ID>"
export CLAUDE_CODE_SUBAGENT_MODEL="<MODEL_ID>"
claudeUse the base URL without /v1; Claude Code adds /v1/messages. Run /status inside Claude Code to confirm that the Anthropic base URL points to Cortecs.
For persistent or managed configuration, see the Claude Code gateway documentation.
Last updated