Claude Code
Connect Claude Code to the provod.ai Anthropic Messages-compatible endpoint.
Last updated on
Use the Claude Code connection values
Create a platform key in the cabinet. Claude Code uses the Anthropic Messages format and adds /v1/messages itself, so its settings are:
| Setting | Value |
|---|---|
ANTHROPIC_BASE_URL | https://api.provod.ai without /v1 |
ANTHROPIC_AUTH_TOKEN | Your provod.ai platform key |
| Model | A supported canonical ID or published alias, passed explicitly |
Remove a stale ANTHROPIC_API_KEY: it uses a different authentication path and can override or interfere with ANTHROPIC_AUTH_TOKEN.
Install the configuration
The installer updates an existing Claude Code settings file; it does not install Claude Code. If the file already exists, both installers create a timestamped backup before changing it.
export PROVOD_API_KEY="sk_..."
curl -fsSL https://app.provod.ai/install/claude-code.sh | \
PROVOD_API_KEY="$PROVOD_API_KEY" shThe installer writes ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and an empty ANTHROPIC_API_KEY. Review the printed settings path and backup path after it finishes.
Configure manually
Back up an existing ~/.claude/settings.json. Prepare the directory and an absent file without overwriting existing settings, restrict the file to its owner, and clear the stale shell variable:
export PROVOD_API_KEY="sk_..."
umask 077
mkdir -p ~/.claude
if [ ! -e ~/.claude/settings.json ]; then
printf '%s\n' '{}' > ~/.claude/settings.json
fi
chmod 600 ~/.claude/settings.json
unset ANTHROPIC_API_KEYOpen the file in an editor. If it has no top-level env object, add one; otherwise keep its existing fields. Remove the ANTHROPIC_API_KEY property from env and merge this fragment without deleting any unrelated settings:
{
"ANTHROPIC_AUTH_TOKEN": "paste-value-from-PROVOD_API_KEY",
"ANTHROPIC_BASE_URL": "https://api.provod.ai"
}After saving, enforce owner-only access again:
chmod 600 ~/.claude/settings.jsonFor a temporary setup in the current shell only:
export PROVOD_API_KEY="sk_..."
export ANTHROPIC_BASE_URL="https://api.provod.ai"
export ANTHROPIC_AUTH_TOKEN="$PROVOD_API_KEY"
unset ANTHROPIC_API_KEYThe settings file contains the platform key
Protect Claude Code settings and installer backups because they contain the key. Do not commit them. If either file is exposed, revoke the key in the cabinet and create a replacement.
Verify the endpoint before Claude Code
This direct request checks the base, key, Messages path, header, and default alias independently of the CLI:
export PROVOD_API_KEY="sk_..."
curl --fail-with-body --silent --show-error https://api.provod.ai/v1/messages \
-H "Authorization: Bearer $PROVOD_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"max_tokens": 64,
"messages": [
{ "role": "user", "content": "Reply with ok" }
]
}'The response text is in content[0].text. If this fails, fix the endpoint or key before diagnosing Claude Code.
Select and verify a model explicitly
The current Messages contract accepts supported canonical IDs such as anthropic/claude-sonnet-4.6 and published aliases such as claude-sonnet-4-6. It also accepts supported regular chat IDs and their configured aliases; see Anthropic Messages for current examples.
Claude Code's picker may not list a third-party catalog. Pass the model explicitly:
claude --model claude-sonnet-4-6For another model, copy a current ID or published alias from model discovery instead of guessing one. A public error code is the client-facing code returned by the API; when the Anthropic-shaped envelope has no separate code, record error.type, HTTP status, message, endpoint, time, and masked key prefix.
See API authentication for rotation and safe diagnostics. The complete request and response contract is in Anthropic Messages.