You can change Claude Code’s model with /model during a session, pass claude --model when you launch it, or set a preferred model in persistent configuration. Those controls select a model; they do not necessarily change where requests are sent. Provider routing—through Anthropic, a supported cloud platform, or a gateway—requires separate configuration. “Any model” is not an official compatibility promise: Anthropic does not support routing Claude Code to non-Claude models through gateways, and OpenRouter warns that other providers may not work correctly.
Which of the three model-selection methods should you use?
Use the method that matches how long you want the choice to last. The options below select a model identifier; they do not, by themselves, switch the API endpoint.
As an Amazon Associate I earn from qualifying purchases.
| Method | When it applies | How to use it |
|---|---|---|
| In-session selection | Change the model in the active Claude Code session | /model or /model <alias-or-name> |
| Launch-time selection | Choose a model for one Claude Code session | claude --model <alias-or-full-model-name> |
| Persistent preference | Set a default for future use | Configure the model through Claude Code settings or environment configuration |
Change the model during an active session
Run /model to open model selection and choose from the options available to your account. To switch directly, use /model <alias-or-name>. The available choices depend on account eligibility and current Claude Code configuration; do not assume every model is available to every user. See the Claude Code model configuration guide.
Use /status to check the current model, as described in Anthropic’s model configuration documentation.
#1 Best Overall
Choose a model for one launch
Start Claude Code with:
claude --model <alias-or-full-model-name>
The CLI reference says this overrides the configured model and ANTHROPIC_MODEL for that session. It is the clearest choice for a temporary change when you know the model alias or full name accepted by your configuration. Check Anthropic’s CLI reference and model configuration guide for current options.
Set a preferred model for future use
Claude Code also supports a model override through ANTHROPIC_MODEL. For a persistent preference, use Claude Code settings or environment configuration appropriate to your installed version. The exact setting and precedence can depend on the configuration in use, so consult the current model configuration guide rather than copying an old example.
Rank #2
How do you change the provider or request endpoint?
A model choice and a provider route are separate controls. --model selects the model identifier; ANTHROPIC_BASE_URL changes the API endpoint when configuring a compatible gateway. Pointing to a different endpoint does not, on its own, establish which models that endpoint serves.
Use Anthropic’s API
Claude Code uses Anthropic’s API by default, according to Anthropic’s setup guide. For the standard route, select an available model using one of the three methods above.
Rank #3
Use a supported cloud provider
Anthropic’s setup documentation lists Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry as provider options. Each requires its own cloud credentials and provider-specific configuration. Model IDs, regions, authentication steps, and eligibility may change, so follow the current guide for the provider you use instead of relying on old environment-variable examples.
Use a gateway or proxy
A gateway can act as a centralized layer for credentials, usage attribution, budgets or rate limits, auditing, and provider switching. These are potential gateway capabilities, not features guaranteed by every gateway. Configuration typically involves a base URL and credential, with API format and rollout steps depending on the gateway. Anthropic’s gateway documentation says it does not endorse, maintain, or audit third-party gateways and does not support routing Claude Code to non-Claude models through any gateway.
Rank #4
Can Claude Code use OpenRouter or other non-Claude models?
OpenRouter documents an integration pattern using its Anthropic-compatible Messages API: set ANTHROPIC_BASE_URL to https://openrouter.ai/api and configure the required credentials and model according to its Claude Code integration guide. OpenRouter cautions that Claude Code is optimized for Anthropic models and may not work correctly with other providers; it recommends Anthropic’s first-party provider for maximum compatibility. This is OpenRouter’s integration guidance, not an Anthropic compatibility guarantee.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Accordingly, “Claude Code with any model” overstates what is officially supported. Anthropic’s policy does not support non-Claude model routing through gateways, and another provider’s documented connection pattern does not guarantee that every model or feature will work reliably.
Best Value
What is the fastest low-setup model change?
If Claude Code is already installed and you want an option offered to your account, start it and run /model, then select a model. This avoids gateway setup. No source establishes a measured two-minute completion time; actual setup time depends on installation, account access, credentials, and configuration.
For a gateway, first configure the gateway and obtain its endpoint and credentials, then apply its documented Claude Code settings. There is no universal two-minute setup: the time depends on whether those prerequisites are already in place.
Quick Recap
What to check before choosing a route
- Where requests go: Anthropic, a supported cloud platform, or a gateway.
- Who handles credentials and billing: This varies by provider and gateway configuration.
- Whether the model is supported: Verify the current model, account eligibility, and provider-specific requirements.
- How long the choice lasts: Use
/modelin-session,--modelfor a launch, or settings/environment configuration for a default. - Organizational controls: If you need centralized auditing, budgets, rate limits, or provider switching, confirm that the gateway you choose actually provides them.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




