# Providers and models
A provider supplies the model used by magi-code. Connect at least one provider, then choose a model for each session.
## Connect a provider
Enter `/login` and choose:
- **OpenAI Codex**: browser sign-in with a ChatGPT account.
- **OpenAI**: set `OPENAI_API_KEY` before launching magi-code.
- **Anthropic**: set `ANTHROPIC_API_KEY` before launching magi-code.
- **Claude Subscription**: install Claude Code, run `claude auth login`, then refresh model catalog and select `claude-subscription/<model-name>`. Uses CLI-managed claude.ai login, not an API key.
- **Custom Provider**: enter an OpenAI-compatible base URL and optional API-key environment-variable name.
API-key providers show environment setup instructions instead of a key-entry field. Restart magi-code after setting an environment variable.
Example:
```sh
export ANTHROPIC_API_KEY="your-key"
magi-code
```
Do not put keys in `settings.json`, prompts, or repository files.
Claude Subscription requires the installed `claude` CLI and an active claude.ai sign-in. Magi-code runs `claude` from `PATH`, falling back to `~/.local/bin/claude`. It works on macOS, Linux, and WSL; native Windows is unsupported, so run magi-code and Claude Code inside WSL. It does not store or reuse Claude credentials in magi-code. Keep `ANTHROPIC_API_KEY` and other Claude backend overrides unset when using this provider. `/logout` cannot sign out the CLI; use `claude auth logout`.
Subscription refresh lists Claude candidates from models.dev Anthropic catalog, not models verified for your account. CLI may reject a candidate depending on version, plan, or availability. Cache-only selection does not contact models.dev or probe CLI; inference still checks CLI readiness. If refresh fails, cached candidates remain visible only when CLI is ready.
Reasoning selections pass through Claude CLI `--effort`; CLI sets the output limit. When a candidate is unavailable, the resulting error identifies the category without exposing raw provider output.
## Choose a model
Enter `/model` or press `Alt-M` while idle. Pick a provider and model from the cached catalog.
If no models appear:
1. Open `/settings`.
2. Select **Models**.
3. Choose **Refresh catalog**.
4. Enable or disable models as needed.
5. Save. The model picker updates for future selections.
You can also launch with a temporary override:
```sh
magi-code --provider openai-codex --model gpt-5.5
```
## Adjust reasoning and response detail
Mission Control shows model and reasoning controls near the prompt. Available reasoning levels depend on provider and model.
Response detail controls visible answer length, latency, and cost where supported. It does not change reasoning effort or impose an exact answer length.
## Fast mode
Use `/fast on`, `/fast off`, or `/fast status`. Fast mode requests an eligible provider service tier; provider access, billing, and actual speed still depend on your account and model.
## Custom providers
Use `/login`, choose **Custom Provider**, and supply:
- a stable provider ID
- display label
- API base URL
- optional environment-variable name for its API key
- optional `models.dev` namespace
Custom providers can need advanced JSON settings for endpoint choice, reasoning behavior, extra model IDs, response detail, or Fast tiers.
## Sign out
Use `/logout <provider-id>`. Signing out removes that provider's stored credentials or global custom-provider metadata. It does not delete sessions.
## Advanced reference
See [Provider authentication](../features/provider-authentication.md) and [model/provider settings](../features/configuration.md#model-and-provider-options) for exact provider behavior, custom fields, credential storage, and refresh rules.