查看中文版 →

Deutsche Version ansehen →

Открыть русскую версию →

Ver versión en español →

Log inChoose a plan
Blog · Setup guides

Use a Custom API in Claude Code: settings.json Setup

Add two variables to settings.json and run /status to confirm requests route through CodingPass.

If you only want the three-step quick reference, see the Claude Code setup guide. This post starts with what Claude Code does, then walks through the setup.

What Claude Code is

Claude Code is Anthropic's own coding agent. It reads your repository, lays out a plan, edits multiple files, runs tests, and inspects terminal output to keep debugging. You can customize it per project:

  • CLAUDE.md: holds project conventions
  • Slash commands and skills: package common workflows
  • Hooks: run your scripts before or after tool calls
  • Subagents: handle side tasks in their own context
  • MCP servers: plug in as usual

The official docs list four entry points: terminal, IDE, desktop app, and browser. The ones that read settings.json are:

  • Terminal: the claude command
  • IDE: the VS Code and JetBrains extensions run the same Claude Code underneath
  • Scripts and CI: claude -p runs a single prompt non-interactively

The desktop app is separate: Claude Desktop ignores settings.json and connects via Gateway mode instead—see the Claude Desktop setup guide.

Once connected to CodingPass, Claude Code still uses Anthropic's official model IDs: Go defaults to Sonnet 5.5 (claude-sonnet-5-5), Plus unlocks Opus 5.5, Pro unlocks Fable 5.2, and quick edits can go to Haiku 5.5. Requests are metered against your plan allowance with no surprise charges.

Setup walkthrough

These steps were verified on a fresh VM running Claude Code 2.1.327 with no prior claude.ai login.

Prerequisites

Install Claude Code, then open the Keys page in the CodingPass dashboard and create a key with the tool set to Claude Code. The key starts with cp-live-.

Edit settings.json

Open ~/.claude/settings.json (%USERPROFILE%\.claude\settings.json on Windows), or create it if it does not exist:

~/.claude/settings.json
{  "$schema": "https://json.schemastore.org/claude-code-settings.json",  "env": {    "ANTHROPIC_BASE_URL": "https://codingpass.ai",    "ANTHROPIC_AUTH_TOKEN": "cp-live-…"  },  "model": "claude-sonnet-5-5"}
  • Set the base URL to https://codingpass.ai without /v1.
  • Set model to match your plan: claude-sonnet-5-5 on Go, or claude-opus-5-5 on Plus and above. If you omit it, Claude Code defaults to Opus 5.5.
  • The file must be valid JSON—a single trailing comma breaks the whole config. Keeping $schema lets your editor highlight mistakes.

Once saved, quit any running Claude Code session completely, then run claude inside your project directory.

Send a message to verify

Check the line below the logo: it should show the model name and API Usage Billing. Send a quick prompt—if it replies normally, you are connected.

Claude Code 2.1.327 startup screen showing Sonnet 5.5 · API Usage Billing under the logo, with the prompt Say hi in five words and the reply Hello there, nice to meet you!
API Usage Billing in the header confirms it is using your API key rather than a claude.ai subscription.

If you would rather skip the interactive UI, run a single non-interactive command and check that it returns 2:

Terminal
claude -p "1+1, output only the answer"

Then run /status to double-check:

  • Anthropic base URL: https://codingpass.ai
  • Auth token: ANTHROPIC_AUTH_TOKEN, confirming it is using your CodingPass key rather than an old claude.ai session
  • Setting sources: the config files loaded—here, User settings
Status tab of /status showing Auth token as ANTHROPIC_AUTH_TOKEN, Anthropic base URL as https://codingpass.ai, and Setting sources as User settings
The Anthropic base URL and Auth token lines in /status.
Boarding

Keep Claude Code. Fix the monthly bill.

One settings.json, Sonnet 5.5 from a month. Cancel anytime.

  • Request ID on every response
  • Full refund if you've used 5% or less
  • No surprise charges
Choose GoClaude Code guide

$10/mo until you cancel.