Skip to main content
Use this guide to route Claude Code model calls through Nusabase. Claude Code appends /v1/messages to ANTHROPIC_BASE_URL, so configure the root URL: https://api.nusabase.io.

When To Use This

  • You primarily use Claude Code from the terminal.
  • You want to keep the Anthropic Messages request format.
  • You want API keys, quota, and usage to go through Nusabase.

Prerequisites

  • Claude Code is installed.
  • You have a Nusabase API key: sk-....
  • Your machine can reach https://api.nusabase.io.
  • The example model qwen3.5-flash appears in the current pricing docs. Use /v1/models as the source of truth.

Configure Environment Variables

Linux / macOS / WSL:
Windows PowerShell:
Configuration notes:

Persistent Configuration

Write user-level config to ~/.claude/settings.json:
For shared project config, do not include a real API key:

Verify Nusabase

Start Claude Code

In the interactive session, send:

Model Selection Notes

Claude Code gateway model discovery only adds some Anthropic-style model IDs to the model picker. For non-Claude names such as qwen3.5-flash, set ANTHROPIC_MODEL explicitly. To try gateway model discovery:

Troubleshooting

Next, see First Request Example.

References