Routescope APIRoutescope API
Client Tool Setup

Claude Code

Claude Code setup guide for pointing Claude Code to Routescope through environment variables

Keep these values handy

Claude Code uses an Anthropic-style setup:

  • ANTHROPIC_AUTH_TOKEN: the full sk-... secret copied from the console
  • ANTHROPIC_BASE_URL: https://api.routescope.ai
  • Model: choose after launching Claude Code with /model

Claude Code now has two usage forms — pick whichever fits your needs:

  • Command-line CLI: The original form, runs in the terminal, closest to the official Anthropic Claude Code experience.
  • Claude Desktop GUI: Graphical interface, no commands required — choose Gateway on the login page and fill in your Routescope API.

Step 1: Create a Key in Routescope

  1. Sign in to Routescope.
  2. Follow Get Base URL and API Key to create a token.
  3. Copy the full sk-... secret from the token list.

Important

Use the full secret directly. Do not remove the sk- prefix.

Step 2: Parameter Mapping

Claude Code FieldValueNotes
ANTHROPIC_AUTH_TOKENsk-...Claude Code sends it as Authorization: Bearer ...
ANTHROPIC_BASE_URLhttps://api.routescope.aiUse the API root. Do not add /v1
/modelChoose a model available to your accountSelect it after Claude Code launches
ANTHROPIC_CUSTOM_MODEL_OPTIONOptionalUse only when manually adding a gateway model entry

Step 3: Set It in Claude Code

setx ANTHROPIC_AUTH_TOKEN "sk-your-token"
setx ANTHROPIC_BASE_URL "https://api.routescope.ai"

Close the current terminal, reopen PowerShell, then start claude.

export ANTHROPIC_AUTH_TOKEN="sk-your-token"
export ANTHROPIC_BASE_URL="https://api.routescope.ai"

Save these values to your shell profile, reload it, then start claude.

Step 4: Launch Claude Code and Choose a Model

claude

Then run:

/model

If the model or alias you want is already listed, select it. If a gateway model is not listed but supports Anthropic-style calls, add a custom model entry:

setx ANTHROPIC_CUSTOM_MODEL_OPTION "claude-sonnet-4-6"
setx ANTHROPIC_CUSTOM_MODEL_OPTION_NAME "Sonnet via Routescope"
export ANTHROPIC_CUSTOM_MODEL_OPTION="claude-sonnet-4-6"
export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Sonnet via Routescope"

Step 5: Verify the Setup

After launch, send:

Reply with "Claude Code is connected to Routescope", then list the top-level files in the current project.

FAQ

Why does ANTHROPIC_BASE_URL use the root domain instead of /v1?

Claude Code uses Anthropic-style endpoints and builds the API path itself. Use https://api.routescope.ai, not https://api.routescope.ai/v1.

Why am I getting 401 / 403?

Check whether ANTHROPIC_AUTH_TOKEN is complete, whether the token is disabled, expired, or out of quota, whether the selected model is allowed, and whether IP restrictions are blocking the request.

Why do I see context_management: Extra inputs are not permitted?

This usually means Claude Code experimental betas are sending an extra context_management field that the gateway or upstream provider does not accept. Disable experimental betas in Claude Code settings:

{
  "env": {
    "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1"
  }
}

Save, close the current terminal, reopen it, and run claude again.

Why is my target model missing from /model?

Confirm that your account has access to the model. If the gateway model is not in Claude Code's built-in list but supports Anthropic-style calls, add it with ANTHROPIC_CUSTOM_MODEL_OPTION.

Claude Desktop GUI Setup Guide

The official Anthropic desktop app exposes a Gateway entry in developer mode. You can skip the claude.ai login entirely and fill in your Routescope Base URL and API Key — fully graphical, no command line required.

When this fits

  • You don't want to touch the command line and prefer a regular chat-app style interface
  • Your claude.ai account can't be registered or keeps getting risk-flagged
  • You already use Claude Code CLI and want a graphical version for everyday chat
  • You want to write docs, do research, or generate web pages and small tools (Artifacts render inline)

Step 1: Prepare your Base URL and API Key

Generate a token in the Routescope console, and copy two values:

  • Base URL: https://api.routescope.ai
  • API Key: The full key starting with sk-

Tip

These two values are identical to what you'd use for the Command-line CLI tab. If you already have CLI working, reuse the same credentials.

Step 2: Download and install Claude Desktop

Download page: claude.ai/download

  • macOS: Download the .dmg, drag into Applications. Requires macOS 13 or later.
  • Windows: Download the .msix, double-click to install. Requires Windows 10 or 11.

Windows users — heads up

If you've never installed virtualization-related components, the first run will ask you to enable the "Virtual Machine Platform" feature and reboot. Save any unsaved work before starting.

Critical step

Launch it once after install to let it initialize. When you see the login window, close it directly — do NOT log in with a claude.ai account.

Step 3: Enable Developer mode

A fresh install hides the third-party API entry by default. You need to flip on developer mode first.

Click in this order:

Top menu bar → Help → Troubleshooting → check Enable Developer mode

Claude Desktop auto-restarts after you tick the box. After restart, a new Developer menu appears in the menu bar.

Step 4: Configure the Gateway

Click:

Developer → Configure third-party inference

A configuration dialog will pop up. Fill in the fields as below:

FieldValue
Inference ProviderSelect gateway
Base URLhttps://api.routescope.ai
API KeyThe full sk-... key from your Routescope console

Do NOT append /v1/messages

Base URL should be the root only — https://api.routescope.ai. The desktop app appends the path itself.

When done, click Apply locally at the bottom of the dialog (not Export).

Step 5: Fully quit and relaunch Claude Desktop

For the config to take effect, you must fully terminate the background process before reopening.

  • macOS: Press Cmd + Q, or use the menu bar Claude → Quit Claude (closing the window is not enough — it keeps running in the background)
  • Windows: Right-click the Claude icon in the system tray → Quit

Then reopen Claude Desktop.

Step 6: Verify the configuration

If everything worked, after relaunch you should see:

  • Only Cowork and Code tabs in the left navigation
  • No Chat tab
  • No login prompt at startup

Send any message to test — if you get a normal reply, you're set.

If the Chat tab is still showing

The config wasn't picked up. Go back to Step 4 and verify:

  • You really clicked Apply locally (not Export)
  • You fully terminated the background process before reopening (closing the window doesn't count)

What Cowork and Code tabs do

Once configured, Claude Desktop ships two work modes:

  • Cowork mode: Everyday chat and task collaboration. Write weekly reports, summarize meeting notes, edit docs, do research, generate web pages or small tools (Artifacts render inline). Reads your designated working directory and integrates with MCP tools and Skills. For anyone who wants AI to help with work but doesn't write code.
  • Code mode: Embedded graphical Claude Code — read project code, edit files, run commands. Just click the Code tab; no CLI install required. For coding, scripting, or web projects.

In short: use Cowork for chat, use Code for coding — one app, two scenarios.

FAQ

Will my chat history sync to claude.ai?

No. Since you never logged into a claude.ai account, conversations are stored locally only. Switching computers means migrating manually or starting over.

What about my existing claude.ai web conversations?

Untouched. The Gateway mode runs on a completely separate data set and doesn't affect your existing claude.ai account or chat history.

Can I run regular mode and Gateway mode at the same time?

No. On the same machine under the same user, Claude Desktop can only run one mode. To use both, set up two OS user accounts and install separately under each.

How is API billing calculated?

Gateway mode bills per API usage — pay only for what you use. Routed API pricing is usually cheaper than the official subscription, but for heavy all-day usage, estimate the cost first in your Routescope console.

How is this guide?

Last updated on