Skip to main content
When your organization allows Bring your own subscription (License model), Claude Code can run on your own Claude plan (Pro or Max) through the AI Gateway. Your calls cost your organization nothing and count toward no budget, while your organization’s model rules still apply and your calls still show in your usage.

Set up Claude Code on your plan

Connect a client with Claude Code selected and the Use my Claude Pro or Max plan first checkbox

The Claude Code option in AI models and keys, with Use my Claude Pro or Max plan first.

Available when your organization turns it on: an admin allows Bring your own subscription in the License model. Until then the gateway answers that your own Claude plan is not enabled.
Claude Code keeps your Claude plan sign-in and sends your calls through the AI Gateway. You need an xpander API key from AI models & keys (Create key). The quick way: in AI models & keys, under Connect a client, pick Claude Code and tick Use my Claude Pro or Max plan first. Choose Copy setup command, paste it in your terminal and press Enter; it creates a key for you. Then run /login in Claude Code and choose your Claude account. To set it up by hand instead, follow these steps. Unlike a setup with only an xpander key, this option needs Claude Code signed in with your Claude plan first.
  1. Sign in with your plan. Run claude, type /login, and choose your Claude account (Pro or Max).
  2. Point Claude Code at the gateway, for every session. Add this to Claude Code’s settings file, ~/.claude/settings.json on macOS and Linux (inside WSL when you use it), %USERPROFILE%\.claude\settings.json on Windows. Replace <your key> with your xpander API key:
    Do not add ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY, and make sure your terminal does not set them: either one replaces your plan sign-in. The address is the same when your organization runs a Hybrid install. Your own plan is not available on an Air-Gapped install. To try it in one terminal only, set the same values there instead. The commands differ by system:
    With WSL, run the commands inside WSL, not in Windows. The bash form NAME=value claude does nothing in PowerShell or cmd, and Claude Code then goes straight to Anthropic.
  3. Use Claude model names. Calls on your plan go to Anthropic only. Keep Claude Code’s own model names, such as claude-sonnet-4-6, rather than a model ID from another provider.
  4. Check that it works. Run claude -p "reply with exactly: OK". In Claude Code, /status must show your Claude account and https://llm-gw.xpander.ai as the base URL. If it shows an auth token or API key instead, ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY is set somewhere and replaces your plan. An admin can also confirm it in Logs: your newest request shows the client Claude Code and the license model Bring your own subscription, with the cost covered by your plan and no credits used.

If something goes wrong

Any other message is explained on Errors and what to do.

When your plan hits its limit

Your plan’s own usage limits apply. When one is reached, AI models & keys shows until when, for example Your Claude plan’s usage limit is reached until Thu, Oct 8, 8:00 AM. Calls use company models until then. Until the plan resets:
  • By default your calls continue on company models until the plan resets: your organization’s key, or xpander’s on xpander cloud. Those calls count toward your budgets.
  • To wait for your plan instead, set When my Claude plan hits its limit to Pause in AI models & keys. Calls are then refused with the reset time until the plan resets.
  • When your organization pauses plan calls for everyone, the choice is locked: Your admin set calls to pause when a plan hits its limit.
The full order is on Licenses and who pays.

Stop using your plan

Remove ANTHROPIC_CUSTOM_HEADERS from Claude Code’s settings and set it up with your xpander key instead (Connect your tools), or run /logout in Claude Code.