Skip to main content
Claude Code uses the Anthropic Messages protocol. Hostlinku provides a compatible endpoint at POST /v1/messages (including /v1/messages/count_tokens), so Claude Code can be directed to Hostlinku simply by setting an environment variable—no additional proxy is needed.

Authentication: AUTH_TOKEN or API_KEY?

Both are accepted by the gateway; choose one—do not enter both with different values.

VS Code & JetBrains Extensions

The Claude Code extension checks for the login on its own, so the same variables must also be specified in the extension settings — VS Code: claudeCode.environmentVariables in settings.json:
In JetBrains, set the same variable in Settings → Tools → Claude Code → Environment variables (or make sure the IDE is running from a shell that has already exported that variable).

Use a non-Claude model

Since the gateway translates protocols, the sonnet/haiku alias can be set to any slug from the catalog:
Features that depend on the model’s capabilities (tool use, extended thinking, vision) are determined by the target model’s capabilities—check the capabilities field in the catalog.

Troubleshooting

  • 401 authentication_error even though the key is correct — old OAuth credentials are still being used. Run /logout, log out, and make sure ANTHROPIC_BASE_URL is accessible (/status).
  • Model not found (404) — meaning it hasn’t been pinned yet, so Claude Code sends the model name by default. Set ANTHROPIC_DEFAULT_*_MODEL to the catalog’s slug.
  • 400 max_tokens exceeds the limit — reduce max_tokens via CLAUDE_CODE_MAX_OUTPUT_TOKENS (e.g., 32000) if the target model has a smaller output limit.
  • Rate limit (429) — Claude Code can run multiple sub-agents in parallel. See the limits at Usage & Limits.