Use Laozhang API in Claude Code

Prices and modelsEndpoint verified 2026-11-09

Generate a Claude Code config from the Anthropic-compatible endpoint in Laozhang API's docs. The API key in the config is a placeholder; replace it with a key you create at Laozhang API.

Endpoints

  • Pay as you gohttps://api.laozhang.aiThe token must be in the Claude Code group; set the fast model, or Claude Code requests a default Haiku model the site does not offer.Docs · verified 2026-11-09

Generate the config

Pick from the 53 models this provider sells, or type another model name.

Save to ~/.claude/settings.json; merge it in if the file already exists
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.laozhang.ai",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_API_KEY": "",
    "ANTHROPIC_MODEL": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_FABLE_MODEL": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5"
  }
}

Models and prices

ModelInputOutputRatio
Claude Fable 5.2claude-fable-5-2$8.39$41.971.05×
GPT-6.1 Terragpt-6.1-terra$1.05$5.251.05×
Kimi K3.1 Prokimi-k3.1-pro$2.10$10.491.03×
Kimi K3.1 Prokimi-k3.1-pro-highspeed$4.20$20.992.06×
MiniMax-M3.1-FlashMiniMax-M3.1-Flash$0.15$0.601.00×
Gemini 4 Argongemini-4-argon$2.10$10.491.05×
Claude Haiku 5.5claude-haiku-5-5$0.105$0.5251.05×
GPT-6.1 Solgpt-6.1-sol$2.10$10.491.05×
Claude Sonnet 5.5claude-sonnet-5-5$2.10$10.491.05×
Claude Opus 5.5claude-opus-5-5$4.20$20.991.05×
GPT-6 Lunagpt-6-luna$0.105$0.5251.05×
GPT-6 Solgpt-6-sol$2.10$10.491.05×
Grok 4.7grok-4.7$2.10$6.301.05×
DeepSeek V4.1 Flashdeepseek-v4-flash-vision-exp$0.462$1.392.31×
GPT-6 Astragpt-6-astra$10.49$52.471.05×
Gemini 3.8 Flashgemini-3.8-flash$0.787$3.941.05×
Claude Fable 5.1claude-fable-5-1$10.49$52.471.05×
Qwen3.8 Flashqwen3.8-flash$0.12$0.4051.00×
GLM-5.3glm-5.3$1.20$4.201.00×
DeepSeek V4 Prodeepseek-v4-pro$1.83$4.162.10×
Gemini 3.7 Flashgemini-3.7-flash$0.787$3.941.05×
Grok 4.6grok-4.6$2.10$6.301.05×
Qwen3.8 Maxqwen3.8-max$1.80$5.401.00×
DeepSeek V4 Flashdeepseek-flash$0.462$1.39—
DeepSeek V4 Flashdeepseek-v4-flash$0.462$1.39—
Claude Opus 5claude-opus-5$5.25$26.231.05×
Gemini 3.5 Flash Litegemini-3.5-flash-lite$0.315$2.631.05×
Gemini 3.6 Flashgemini-3.6-flash$1.57$7.872.10×
Kimi K3kimi-k3$3.15$15.741.05×
GPT-5.6 Lunagpt-5.6-luna$0.21$1.261.05×
GPT-5.6 Solgpt-5.6-sol$4.20$20.991.05×
GPT-5.6 Terragpt-5.6-terra$2.10$12.591.05×
Grok 4.5grok-4.5$2.10$6.301.05×
Claude Sonnet 5claude-sonnet-5$2.10$10.491.05×
GLM-5.2glm-5.2$1.20$4.201.00×
Kimi K2.7 Codekimi-k2.7-code$0.974$4.051.00×
Claude Fable 5claude-fable-5$10.49$52.471.05×
Qwen3.7 Plusqwen3.7-plus$0.30$1.201.00×
MiniMax-M3MiniMax-M3$0.63$2.522.00×
Qwen3.7 Maxqwen3.7-max$1.80$5.40—
Gemini 3.5 Flashgemini-3.5-flash$1.57$9.441.05×
GPT-5.5gpt-5.5$5.25$31.481.05×
Kimi K2.6kimi-k2.6$0.997$4.201.04×
Grok 4.3grok-4.3$1.31$2.621.05×
Claude Opus 4.7claude-opus-4-7$5.25$26.231.05×
GLM-5.1glm-5.1$0.899$3.601.00×
Gemini 3.1 Pro Previewgemini-3.1-pro-preview$2.10$12.591.05×
Claude Sonnet 4.6claude-sonnet-4-6$3.15$15.741.05×
MiniMax-M2.5MiniMax-M2.5$0.315$1.26—
Claude Opus 4.6claude-opus-4-6$5.25$26.231.05×
Kimi K2.5kimi-k2.5$0.63$3.31—
GPT-4.1gpt-4.1$2.10$8.391.05×
GPT-4.1gpt-4.1-2025-04-14$2.10$8.391.05×
$ per 1M tokens. Each model uses the provider's cheapest group; the ratio uses the output price

How to check it works

Restart Claude Code and send a message. If it replies and the request shows up in Laozhang API's console, it is using this endpoint.

FAQ

settings.json or environment variables?

settings.json applies every time Claude Code starts, for long-term use; the environment variables apply to the current terminal only, for a quick try.

How do I switch back to Anthropic?

Remove these variables from settings.json (or close the terminal where you set them), then restart Claude Code.

Does my key pass through this site?

No. The page only generates config text and never asks for your key; the key only goes into the config file or terminal on your own machine.

Claude Code configs for other providers