Claude Code + BazaarLink Setup Guide
Claude Code can use BazaarLink by changing its base URL and API key. The route below speaks to BazaarLink's Anthropic-compatible Messages endpoint.
1. Configure environment variables
Export these variables before starting Claude Code. ANTHROPIC_AUTH_TOKEN is sent as the Authorization token; keep it in your shell environment instead of committing it.
export ANTHROPIC_BASE_URL="https://api.bazaarlink.ai/v1"
export ANTHROPIC_AUTH_TOKEN="your-bazaarlink-api-key"
export ANTHROPIC_MODEL="openai/gpt-5.6-luna"
export ANTHROPIC_SMALL_FAST_MODEL="anthropic/claude-haiku-4.5"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1"2. Configure settings.json instead
If you prefer a persistent Claude Code configuration, put the same values in your user settings file. Replace the placeholder with a real BazaarLink key on your machine.
3. Verify the request path
Run this small Messages request before opening a longer Claude Code session. A JSON response with a model and stop reason confirms that the configured base URL and key reached BazaarLink; then confirm the request in the BazaarLink Logs page.
4. Common errors
401 Unauthorized
Symptom: Claude Code or the curl check reports an authentication error. Cause: ANTHROPIC_AUTH_TOKEN is missing, has a typo, or the shell was not restarted after changing it. Fix: set it to the BazaarLink API key, make sure the request sends Authorization: Bearer, and start Claude Code from that same shell.
404 model_not_found
Symptom: the request reaches the gateway but the selected model is rejected. Cause: ANTHROPIC_MODEL or ANTHROPIC_SMALL_FAST_MODEL is not an exact ID in the current /models response. Fix: fetch https://api.bazaarlink.ai/v1/models and copy an ID exactly, including its provider prefix and punctuation.
Base URL missing /v1
Symptom: the request returns a route 404, or traffic still goes to Anthropic instead of BazaarLink. Cause: the value is missing /v1, includes /messages twice, or points at a different host. Fix: set ANTHROPIC_BASE_URL to exactly https://api.bazaarlink.ai/v1; Claude Code appends /messages.
5. Choose a model
Use the live /models endpoint as the source of truth. These are three valid examples from the brief; copy the full provider/model ID into ANTHROPIC_MODEL or ANTHROPIC_SMALL_FAST_MODEL.
openai/gpt-5.6-luna
anthropic/claude-haiku-4.5
deepseek/deepseek-v4.1-flash