Use NeverMetered with Claude Code

Anthropic's terminal coding agent, pointed at your own base URL and model.

Anthropic Messages
Model
qwen3.8-27b
8,192 max output tokens on the free planReplace YOUR_API_KEY with your key.
  1. 1

    Create an API key

    Create a key in API keys and name it after the tool, for example “Claude Code”. A dedicated key per tool lets you see its usage separately and give it its own parallel-stream cap. The key is shown once; the snippets below use YOUR_API_KEY where it goes.

  2. 2

    Point Claude Code at the gateway

    Set these before starting claude. Every model variable points at the same model: Claude Code asks for its own claude-* model names for the main loop, subagents and background tasks, and those names don't exist here. ANTHROPIC_AUTH_TOKEN sends your key as a bearer token without the interactive API-key prompt that ANTHROPIC_API_KEY triggers.

    export ANTHROPIC_BASE_URL="https://api.nevermetered.com"
    export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
    export ANTHROPIC_MODEL="qwen3.8-27b"
    export ANTHROPIC_DEFAULT_OPUS_MODEL="qwen3.8-27b"
    export ANTHROPIC_DEFAULT_SONNET_MODEL="qwen3.8-27b"
    export ANTHROPIC_DEFAULT_HAIKU_MODEL="qwen3.8-27b"
    export CLAUDE_CODE_SUBAGENT_MODEL="qwen3.8-27b"
    export API_TIMEOUT_MS="600000"
    export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1"
    export CLAUDE_CODE_MAX_OUTPUT_TOKENS="8192"
    claude
  3. 3

    Or make it permanent

    Put the same variables in the env block of your user settings so every session uses them. Merge them into the file if it already exists.

    ~/.claude/settings.json
    {
      "env": {
        "ANTHROPIC_BASE_URL": "https://api.nevermetered.com",
        "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
        "ANTHROPIC_MODEL": "qwen3.8-27b",
        "ANTHROPIC_DEFAULT_OPUS_MODEL": "qwen3.8-27b",
        "ANTHROPIC_DEFAULT_SONNET_MODEL": "qwen3.8-27b",
        "ANTHROPIC_DEFAULT_HAIKU_MODEL": "qwen3.8-27b",
        "CLAUDE_CODE_SUBAGENT_MODEL": "qwen3.8-27b",
        "API_TIMEOUT_MS": "600000",
        "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
        "CLAUDE_CODE_MAX_OUTPUT_TOKENS": "8192"
      }
    }
  4. 4

    Verify it works

    Run a one-off prompt. Inside an interactive session, /status shows the base URL and model in use. The request shows up in Requests within a few seconds, with its input, cached and output tokens.

    claude -p "Reply with the word ready"
Tips
  • Each subagent Claude Code starts runs as its own stream, so parallel subagents count against your parallel-stream limit. Extra requests wait in your queue allowance.
  • Claude Code makes small background requests (for example session titles). On the free tier those count toward your daily requests; CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 cuts the optional ones.
  • Requests can wait in the fair queue when the service is busy, so keep API_TIMEOUT_MS generous. Your plan allows up to 8,192 output tokens per request.
  • Unset ANTHROPIC_API_KEY in the same shell so Claude Code doesn't warn about two competing credentials.

Troubleshooting

model_not_found naming a claude-… model
One of the model variables above is missing, so Claude Code fell back to its own model name. Set all of them, then restart claude.
Claude Code still talks to Anthropic
The variables weren't visible to the claude process. Export them in the same shell (or use settings.json) and check /status.
404 model_not_found
Use a model id exactly as GET /v1/models lists it, for example qwen3.8-27b. Plans can restrict which models a key may call.
429 concurrency_limit_exceeded
All your parallel streams are busy and your queue allowance is full. Lower the tool's parallelism (subagents, batch size), or get more streams on your plan.
Answers stop mid-sentence
The response hit your plan's output cap of 8,192 tokens (finish reason length or max_tokens). Ask for shorter steps, or upgrade for a higher cap.
403 email_verification_required
Free requests need a verified email. Click the link in your verification email (you can resend it from the dashboard), or upgrade.
429 daily_quota_exceeded
You've used today's free requests; agents send one request per step, so they go quickly. The allowance resets at 00:00 UTC, and paid plans have no daily limit.
503 / 504 request_queue_timeout
The service stayed busy longer than the queue timeout and nothing was generated. Retry with backoff, and give the tool a generous request timeout.