Tool setup guides

Claude Code Integration

Connect Claude Code to Halfbill with environment variables and verify a real file edit and test run.

Claude Code can use Halfbill's Anthropic-compatible endpoint. Change the base URL and the auth token, pick a model, and every request from the agent is billed through your Halfbill account.

Install

Install Claude Code using the setup instructions, then check claude --version.

Configure the connection

Create a key in your dashboard, then set these variables in the terminal where you launch Claude Code:

export ANTHROPIC_BASE_URL=https://api.halfbill.uk
export ANTHROPIC_AUTH_TOKEN="your_api_key"
export ANTHROPIC_MODEL=claude-sonnet-5
claude

Use the base URL exactly as shown. Claude Code adds /v1/messages itself. If an existing ANTHROPIC_API_KEY causes an authentication conflict, unset it in this shell before starting.

All Claude models on Halfbill support the tool calls needed to read, edit, and test code. See the model catalogue for the full list.

Choose a model

Set ANTHROPIC_MODEL before launch, or override it for one session:

claude --model claude-opus-5

Claude Code's picker and model-discovery behavior vary by version. An explicit --model value is useful when your model is absent from the picker.

To add a custom picker option, current Claude Code also supports:

export ANTHROPIC_CUSTOM_MODEL_OPTION=claude-sonnet-5
export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Claude Sonnet 5"

To discover the Halfbill models supported by Claude Code's picker, set CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1 before launch. Discovery is subject to the client's model filtering; it does not guarantee that every model appears.

Verify the connection

Open a small project and ask the agent to read a file, make a change, and run its tests. Review the diff and test output, then check the request in your Halfbill dashboard.

Troubleshooting

  • Requests use the wrong endpoint: check ANTHROPIC_BASE_URL in the shell that starts Claude Code and restart the agent after changing it.
  • Authentication fails: verify the Halfbill key and resolve conflicting Anthropic authentication variables.
  • A model is missing from the picker: launch with an explicit --model ID from the catalogue.
  • An optional tool is unsupported: use a model with the required capability, or disable the tool for that session.

Halfbill Code plan key can also be used. Use the canonical model IDs from the catalogue.

How is this guide?

On this page