CLI INTEGRATION

Use 9Router with Claude Code.

Prepare the endpoint and credentials, test a minimal request, then launch your client. Variable names and supported configuration can change; check the current official guidance.

1. Confirm your endpoint

Use the endpoint shown by your current 9Router setup instructions. If running locally, confirm the service is listening and that your client supports the local endpoint.

2. Set environment variables

The following is a template only. Replace the endpoint and variable names with those required by your installed client/version.

export ANTHROPIC_BASE_URL="YOUR_DOCUMENTED_9ROUTER_ENDPOINT"\nexport ANTHROPIC_AUTH_TOKEN="YOUR_9ROUTER_API_KEY"
Do not commit API keys to Git or paste them into public logs. For PowerShell, Windows Command Prompt, or persistent shell profiles, use the syntax appropriate to that shell.

3. Confirm a valid model ID

  1. Request the available models from the configured endpoint.
  2. Choose a model ID that is actually returned by your own endpoint.
  3. Check provider authentication and quota if the request reaches the router but fails upstream.

4. Test and launch

Start with a short prompt and observe the exact error. Avoid changing endpoint, API key, model ID, and provider settings simultaneously; change one variable at a time.

Official references

Documentation ↗ · GitHub / FAQ ↗