Theme
Language
·3 min read

Use Claude Code with any model: custom endpoint setup

Point Claude Code at GetVibe API with three settings.json lines, then run it on Claude Opus 5.5, DeepSeek, Gemini, GLM or Kimi. Which models work and how to check.

Use Claude Code with any model: custom endpoint setup

Claude Code is Anthropic's command-line agent for coding. It talks to one endpoint, /v1/messages in the Anthropic Messages format, and it lets you change the base URL. Point it at GetVibe API and the same CLI can run Claude Opus 5.5, Claude Sonnet 5 or a non-Claude model from our catalog, all on one prepaid key.

Step 1: settings.json

Install Claude Code (npm install -g @anthropic-ai/claude-code, Node.js 22+), then create or edit ~/.claude/settings.json. On Windows the file is %USERPROFILE%\.claude\settings.json.

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "sk-pv-...",
    "ANTHROPIC_BASE_URL": "https://getvibeapi.com",
    "ANTHROPIC_API_KEY": ""
  }
}

Two details matter:

  • ANTHROPIC_API_KEY must be an empty string, not missing. If it is absent, Claude Code ignores the base URL and goes straight to Anthropic.
  • The base URL has no /v1. Claude Code adds /v1/messages itself, so https://getvibeapi.com/v1 would double the path.

Run claude and type /status. The Anthropic base URL line should read https://getvibeapi.com.

Step 2: choose the models

Claude Code has three model slots, Opus, Sonnet and Haiku. By default it uses the Sonnet slot for most tasks and the Haiku slot for quick operations. Each slot is an environment variable, and the value can be any model ID from our catalog that accepts the Messages format:

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "sk-pv-...",
    "ANTHROPIC_BASE_URL": "https://getvibeapi.com",
    "ANTHROPIC_API_KEY": "",
    "ANTHROPIC_DEFAULT_OPUS_MODEL":   "claude-opus-5.5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL":  "claude-haiku-4.5"
  }
}

To run the agent on a lower-cost model, put its ID in the Sonnet slot, for example deepseek-v4.1-flash or gemini-3.8-flash. Use exact catalog IDs: dated Anthropic snapshot names such as claude-haiku-4-5-20251001 do not resolve.

Which models work in Claude Code

Not every model in the catalog accepts the Anthropic Messages format. The public catalog at https://getvibeapi.com/api/catalog marks each model with anthropicFormat. Where it is true, the model works over /v1/messages. At the time of writing that includes:

ModelIDContextPrice
Claude Opus 5.5claude-opus-5.51M$0.1067 input · $0.5334 output per 1M tokens
Claude Sonnet 5claude-sonnet-51M$0.3334 input · $1.6667 output per 1M tokens
GPT-5.6 Solgpt-5.6-sol1.05M$0.0667 input · $0.40 output per 1M tokens
DeepSeek V4.1 Flashdeepseek-v4.1-flash1M$0.0112 input · $0.0445 output per 1M tokens
Gemini 3.8 Flashgemini-3.8-flash1M$0.0097 input · $0.0483 output per 1M tokens
GLM-5.3glm-5.31.048M$0.10 input · $0.3143 output per 1M tokens
Kimi K3kimi-k3262K$0.1715 input · $0.8572 output per 1M tokens
Qwen3.8 Maxqwen3.8-max256K$0.1543 input · $0.4629 output per 1M tokens

The GPT-6 models (Luna, Sol, Astra) do not accept the Messages format and are refused on /v1/messages. To use them in a terminal agent, use Codex CLI, which speaks the Responses API, or any tool with an OpenAI-compatible base URL (see the integrations list).

Common issues

  • 401: check the ANTHROPIC_AUTH_TOKEN value and that ANTHROPIC_API_KEY is "".
  • Requests still go to Anthropic: ANTHROPIC_API_KEY is not set as an empty string.
  • Variables not picked up: settings.json is more reliable than shell profiles, especially on Windows.
  • Model not available: the ID is misspelled, retired or not in the Messages format. Check it on the Models page.

Keep the cost down

Coding agents resend a long, mostly unchanged prefix on every turn. Claude models cache only when the request carries a cache_control breakpoint. If Claude Code does not send one, the gateway adds one for you. Cached input is billed at a fraction of the input rate. The caching guide and our prompt caching article explain how to keep the prefix stable.

The full reference is in the Claude Code guide and Messages and Responses. You pay per token from a prepaid balance. There is no subscription.

Claude Code custom endpointClaude Code ANTHROPIC_BASE_URLClaude Code other modelsClaude Code DeepSeekClaude Code API keyAnthropic Messages API

Try GetVibe API for free

GPT, Claude, Gemini and more through one OpenAI-compatible API. Pay in USD by card or crypto.

Related articles

Use Claude Code with any model: custom endpoint setup | GetVibe API