Skip to main content
Claude Code can use RunInfra through the Anthropic-compatible Messages API. Set the API host, your workspace key, and one RunInfra model id before you start claude.
This integration uses RunInfra hosted models. It does not make those models identical to Anthropic models.

Configure the environment

Use a model whose page lists tool calling. This example uses deepseek-v4-flash for the main session, model aliases, and subagents.
ANTHROPIC_BASE_URL must be the bare host. Claude Code and the Anthropic SDK append /v1. ANTHROPIC_AUTH_TOKEN sends Bearer authentication and does not trigger the API-key approval prompt. You can set ANTHROPIC_API_KEY instead. It sends x-api-key, which works on the Messages routes, but Claude Code prompts once to approve the custom key.

Optional controls

You do not need DISABLE_PROMPT_CACHING. Claude Code may send cache_control, and the Messages API accepts and ignores it. Prefix caching remains automatic on models with cached-input pricing.

What works

  • Multi-tool sessions using client tools that Claude Code executes.
  • Subagents using the model selected by CLAUDE_CODE_SUBAGENT_MODEL.
  • Streaming through the official Anthropic SDK helpers.
  • Thinking display when the selected model returns reasoning.
Anthropic server tools are not available. RunInfra supports the client-tool loop used by Claude Code, not hosted bash, text editor, web search, or computer-use tools supplied by an API provider.

What to expect

Claude Code can print a diagnostic line that it does not recognize the RunInfra model id. The line is harmless when requests continue successfully. Set model ids through the environment variables above. Do not use /model to select a RunInfra id because that picker knows Anthropic’s model catalog, not the ids available from RunInfra. If you need to discover model ids, use Bearer authentication. x-api-key is limited to /v1/messages and /v1/messages/count_tokens.

Check usage and credits

See settled usage in the dashboard’s usage page. Read the current workspace balance from GET /v1/credits:

Anthropic Messages

Read the request, tool, thinking, stream, and error contract.

Authentication

Understand Bearer and x-api-key scope.

Models

List the model ids available to your key.