# Any model

> Every subscription and API sc can run Claude Code on, in one matrix, and how Claude Code's model roles map to them.
>
> Run Claude Code on your Claude plan, an API key, Codex, Grok, OpenCode, OpenRouter or a local server. A profile in config.toml maps each Claude Code role to a model.

`sc` sends each model request Claude Code makes to the provider your profile names, with your own key or subscription. This is built into `sc` itself, not a plugin. Pick a row in the table below, follow its page to add the endpoint and a profile, then check and launch it.

1. Check the profile

   ```sh
   sc profiles
   ```

   `sc` prints one row per profile and role: the model that role is sent to. A `sonnet` or `haiku` row the profile does not set is shown with a `↑` (`^` on a terminal without Unicode) and the model it inherits; a `fable` row it does not set gets no row.

2. Launch on it

   ```sh
   sc -u <profile> <project> <agent>
   ```

   Claude Code opens on that profile. Without `-u`, `sc` uses your top-level `default_profile`, or `direct` (plain Claude Code, no gateway) if it is unset.

The recommended setup, Claude Opus on the main loop and DeepSeek V4.1 Flash for subagents, is a [five-step walkthrough](/docs/custom-profiles#recommended-profile-walkthrough).

## What works

| Provider | How you pay | Auth | Wire format | Page |
|---|---|---|---|---|
| Claude, on your Claude Code login | your Claude plan | Claude Code's own login: `direct`, or `passthrough` in a profile | Anthropic, untouched | [Anthropic and Claude](/docs/provider-anthropic) |
| Anthropic API | per token | API key, `x-api-key` | `anthropic-messages` | [Anthropic and Claude](/docs/provider-anthropic#claude-with-an-api-key) |
| Any Anthropic-compatible API | the provider's terms | API key, `x-api-key` or `bearer` | `anthropic-messages`, no translation | [Anthropic and Claude](/docs/provider-anthropic#any-anthropic-compatible-api) |
| OpenAI, DeepSeek, Groq, Together, Fireworks, any OpenAI-compatible API | per token | API key, `bearer` | `openai-compat` | [Any OpenAI-compatible API](/docs/provider-openai-compatible) |
| OpenAI Responses API | per token | API key, `bearer` | `openai-responses` | [Any OpenAI-compatible API](/docs/provider-openai-compatible#the-openai-responses-api) |
| OpenCode | OpenCode subscription | API key, `bearer` | `openai-compat`; some models `anthropic-messages` | [OpenCode](/docs/provider-opencode) |
| Codex | ChatGPT Plus or Pro | OAuth, `sc auth codex` | `openai-responses` | [Codex](/docs/codex-setup) |
| Grok | SuperGrok | OAuth, `sc auth grok` | `openai-compat` | [Grok](/docs/provider-grok) |
| OpenRouter | prepaid credits | API key, `bearer` | `openai-compat` | [OpenRouter](/docs/provider-openrouter) |
| Ollama, LM Studio, vLLM, llama.cpp | your hardware | none (any key string; the server ignores it) | `openai-compat` or `anthropic-messages` | [Local models](/docs/provider-local) |
| Gemini over Google's own API | — | — | `gemini`: not yet | — |

Gemini's own API is not supported yet: `format = "gemini"` is reserved and answers `501`. Gemini models on OpenRouter work.

**How roles map to models**

Claude Code names one of four tiers on every request:

| Tier | Asked for by |
|---|---|
| `opus` | the main loop on Opus, and subagents that inherit it or ask for Opus |
| `sonnet` | the main loop on Sonnet, and subagents that ask for Sonnet |
| `haiku` | subagents that ask for Haiku, and Claude Code's small background requests |
| `fable` | the main loop or a subagent on Fable, the tier above Opus |

A [profile](/docs/custom-profiles#write-your-own-profile) maps each tier to `<endpoint>/<model-id>`, and the [gateway](/docs/gateways) sends the request there. Profiles come in two shapes:

- **Hybrid**: at least one role is on a `passthrough` endpoint. Claude Code keeps its login; passthrough and unmapped roles go to Anthropic unchanged, the rest to your endpoints.
- **Full gateway**: every role is on your endpoints; your Claude login is not used.

### What changes on a full gateway

- `sc` points Claude Code at the daemon on a loopback port with a placeholder token. The status line shows `<profile> · <model> · <role>`, and the `/model` picker lists `<profile> · <endpoint>/<model>`.
- Claude Code's auto-mode safety check needs a Claude main-loop model, so `sc` launches with `--permission-mode bypassPermissions`: tools run without prompts. Naming your own `--permission-mode`, or launching with `-i`, stops that. `--permission-mode auto` does not help here, because Claude Code falls back to its default mode and prompts on every tool.
- `sc` sets `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1`, which turns off Claude Code's model-list probe, telemetry and other non-essential requests.
- A Fable request fails unless the profile has a `fable` row.
- Incognito (`-i`) works with a full-gateway profile. It refuses a hybrid, because a hybrid needs the daemon's local proxy in the request path.

### What changes on a hybrid

`sc` adds no permission flag, and Claude Code's checks work as in a plain session while the main loop is Claude. If a hybrid's `opus` and `sonnet` rows (and `fable`, if set) are all `passthrough`, setting the top-level `default_classifier` to a `[classifiers.<name>]` table makes `sc` launch Claude Code in auto mode; Claude answers the safety check while the main loop is Claude ([config.toml](/docs/config-toml)).

The chat relay accepts only `direct`, on either shape, because Claude Code channels need first-party Anthropic auth.
