Skip to main content
With an AI Gateway API key you can run Claude Code on the models your organization gives you. Requests go through AI Gateway like any other: the key only reaches models you’re allowed, and usage counts toward your limit. Claude Code works best with Claude models. Other models (OpenAI, Gemini, DeepSeek and the rest) work too: AI Gateway answers Claude Code in the format it expects for every model.

Set it up

Create a key in My Library › Models and pick Claude Code under Start using this key. Already have a key? Open its menu and select Set up.
  1. Choose your models. Pick a Main model (Claude Code’s Opus and Sonnet, and its subagents) and a Fast model (its Haiku, for quick background tasks). The page builds the settings file from your choice.
  2. Add the settings file. In your project folder, create .claude/settings.local.json and paste the settings from the page. They look like this:
    The file holds your key, so keep it out of git.
  3. Start Claude Code in that folder with claude.
  4. Check it. Run /status: it should show the OpenWork base URL. /model lists your models.
Keep ANTHROPIC_API_KEY empty. A real Anthropic key there makes Claude Code send it instead of your OpenWork key.

Using Claude Code for the first time on this computer

Claude Code reads the project settings file only after its first-run sign-in screen. If it asks you to choose a login method, quit and start it once with your key in the command:
After that, claude in the project folder is enough.

Signed in to Claude Code with a Claude account

If /status shows a Claude account instead of the OpenWork base URL, run /logout, quit, and start claude again.

Model names

Each of your models has a name for Claude Code:
The four characters tell apart models with the same name. [1m] marks models with a 1 million token context window, so Claude Code doesn’t compact the conversation early. Copy names from the page rather than typing them.
  • Claude models are also listed under modelOverrides, so Claude Code knows their limits and features (thinking, effort) as it does for Anthropic.
  • Other models aren’t known to Claude Code. When one is your main model, the settings also set CLAUDE_CODE_MAX_CONTEXT_TOKENS to its context window.
  • /model lists the Claude models it discovers. To switch to another model, type /model openwork/<name> with a name from the page.

When it doesn’t work