Claude Code custom API setup
This page configures Claude Code directly. To manage Claude and Codex providers through a desktop app, use the CC Switch guide.
Before you start
Section titled “Before you start”- Install Claude Code and confirm the
claudecommand runs. - Create a Relyven key that can use the Claude model you need.
- Copy the exact model ID from the dashboard when the client asks for one.
Configure the custom API
Section titled “Configure the custom API”export ANTHROPIC_BASE_URL=https://api.relyven.comexport ANTHROPIC_AUTH_TOKEN="$RELYVEN_API_KEY"claudeUse the service root without /v1. Claude Code adds the Anthropic Messages path.
Store the key in an environment variable or secret manager. Do not put it in a repository, screenshot, or shared prompt.
Verify the connection
Section titled “Verify the connection”Start a new Claude Code conversation and make a short request. Then ask it to inspect a small local project with a tool call. A text reply confirms basic generation; it does not confirm tool events.
For an existing long conversation, save a rollback copy of the client configuration before changing providers. Use a new conversation for the first test so cached client state does not affect the result.
Relyven does not intentionally rewrite supported system, tools, thinking, cache_control, max_tokens, or streaming fields. The selected model still determines which combinations it accepts.
Troubleshooting
Section titled “Troubleshooting”| Result | Check |
|---|---|
401 |
ANTHROPIC_AUTH_TOKEN and the base URL |
403 |
Model permission on the current key |
400 |
Request fields, model capability, context limit, and client version |
429 |
Balance, key limits, and retry-after |
| Text works but tools fail | Tool schema and the returned Anthropic event types |
| Configuration did not change | Start a new shell and a new Claude Code conversation |
For raw API examples, see Anthropic Messages and API error handling.