Integrations
Claude Code
Use Linkex as the model backend for Anthropic's Claude Code CLI.
Linkex accepts the native Anthropic Messages format (/v1/messages), so Claude Code can run against it with two environment variables — no code changes.
Prerequisites: Claude Code installed; a Linkex API key; enough credit for Claude-class models.
Configure
export ANTHROPIC_BASE_URL="https://linkex.ai"
export ANTHROPIC_AUTH_TOKEN="sk-YOUR_LINKEX_KEY"Make it permanent in your shell profile, or per-project in .claude/settings.json:
{
"env": {
"ANTHROPIC_BASE_URL": "https://linkex.ai",
"ANTHROPIC_AUTH_TOKEN": "sk-YOUR_LINKEX_KEY"
}
}Use ANTHROPIC_AUTH_TOKEN (sent as a Bearer token), not ANTHROPIC_API_KEY — Linkex authenticates with Authorization: Bearer.
Pick models
Claude Code's model settings accept any model name Linkex serves:
export ANTHROPIC_MODEL="claude-sonnet-4-5"
export ANTHROPIC_SMALL_FAST_MODEL="claude-haiku-4-5"Model names follow the upstream convention — check availability and prices at linkex.ai/pricing.
First run
claude
# then ask anything; verify usage appears in Console → Usage LogsTroubleshooting
| Symptom | Fix |
|---|---|
| 401 Unauthorized | Key typo, or the key is disabled — check Console → Keys |
| "model not found" | The model name isn't served — copy the exact id from the pricing page |
| Insufficient balance error | Top up: Buying Credits |
| Traffic still goes to api.anthropic.com | ANTHROPIC_BASE_URL not exported in the shell that launched claude |