Coding agents

Claude Code

Connect Claude Code through the Anthropic Messages endpoint.

Success — tested

2026-10-10. Windows text smoke test against a local fake gateway. Claude Code 2.1.296.

Claude Code is a terminal coding agent. This setup sends its Anthropic-format requests to POST /v1/messages.

Before you start

Complete the Quickstart: add credits, create a key, and copy a model ID from Marketplace. Choose a model with tool support for agent tasks. The example ID is claude-sonnet-5-5; replace it with your selection. Install Claude Code and open your project in a terminal.

Configure the tool

Set the variables in the terminal you use to launch Claude Code. ANTHROPIC_BASE_URL takes the host without /v1. The explicit mappings pin the Sonnet, Opus, and Haiku aliases to your chosen model.

macOS / Linux
export UNUSED_API_KEY='sk-unused-...'
export UNUSED_MODEL='claude-sonnet-5-5'
export ANTHROPIC_BASE_URL='https://unused.market'
export ANTHROPIC_AUTH_TOKEN="$UNUSED_API_KEY"
export ANTHROPIC_MODEL="$UNUSED_MODEL"
export ANTHROPIC_DEFAULT_SONNET_MODEL="$UNUSED_MODEL"
export ANTHROPIC_DEFAULT_OPUS_MODEL="$UNUSED_MODEL"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="$UNUSED_MODEL"
export CLAUDE_CODE_MAX_OUTPUT_TOKENS=4096
export MAX_THINKING_TOKENS=1024
claude --model "$UNUSED_MODEL"

No configuration file is required. For persistent non-secret settings, Claude Code uses ~/.claude/settings.json on macOS/Linux and %USERPROFILE%\.claude\settings.json on Windows. Keep the key in your shell or secret manager.

The example sets a 4096-token output budget and a 1024-token thinking budget. Choose budgets that fit the selected offer; these are client settings, not model limits. An output budget above the model's maximum is rejected before inference.

Verify the connection

Ask: “Say hello in one sentence without using tools.” Then open Analytics → Requests. Find the new request by time and model. A response and a matching row confirm that traffic reached your account. This checks the connection, not the quality of repository edits. Use /status to inspect the active credential source and /model to inspect the selected model.

Limits and troubleshooting

Text-only inline role: "system" messages are usually folded into the system prompt. Anthropic's original inline prompt-cache positions are not preserved; per-message effort is handled separately. Read cache billing before comparing cache savings. Features added by newer Claude Code releases may need gateway support.

SymptomFix
Authentication errorRe-enter your unused.market key.
No usable offerCheck Marketplace, Routing, and the key's allowed models.
Credit or budget errorCheck Credits and the key's monthly limit; reduce the output budget if needed.
Stream stops after output startsFind the failure in Requests. A started stream is not retried on another offer.

Sources and verification

Version checked: 2.1.296, 2026-10-10. Official sources: gateway connection, model configuration, environment variables. The local test uses synthetic responses and does not establish full repository-task compatibility.

On this page