---
title: "Use a Custom API in Claude Code: settings.json Setup"
description: "Connect Claude Code to CodingPass by adding ANTHROPIC_BASE_URL and your key to ~/.claude/settings.json, then verify where requests go with /status."
url: https://codingpass.ai/blog/use-custom-api-in-claude-code-settings-json
language: en
updated: 2026-11-19
---
# 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.

[CodingPass team](https://codingpass.ai/about) Published Nov 19, 2026 Updated Nov 19, 2026 8 min read

If you only want the three-step quick reference, see the [Claude Code setup guide](https://codingpass.ai/tools/claude-code). 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](https://codingpass.ai/tools/claude-desktop).

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!](https://codingpass.ai/assets/img/tools/claude-code/header-api-billing.webp)

*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](https://codingpass.ai/assets/img/tools/claude-code/status.webp)

*The Anthropic base URL and Auth token lines in /status.*

Written by CodingPass team

We run CodingPass and test each guide against the latest stable release of the tool before we publish it. Spotted something out of date? Write to [support@codingpass.ai](mailto:support@codingpass.ai).

## Related reading.

Guide

### [Claude Code setup guide](https://codingpass.ai/tools/claude-code)

The three-step setup, plus default models and allowances for each plan.

Guide

### [Claude Desktop setup guide](https://codingpass.ai/tools/claude-desktop)

The desktop app ignores settings.json and connects through Gateway mode.

Reference

### [How allowances and caps work](https://codingpass.ai/usage-limits)

Allowances and caps for every plan and model, and what a 429 means.
