Skip to content

Agent Providers

By default Claudette spawns the official claude CLI authenticated against Anthropic. In Settings > Models, you can also point agents at:

  • Ollama — local LLMs running on your own machine, talking Claude’s wire format directly.
  • OpenAIgpt-* models via the OpenAI API gateway.
  • Codex — ChatGPT subscription-backed Codex through the native codex app-server harness.

On startup Claudette quietly checks for local providers. If it finds the Codex CLI or an Ollama daemon on localhost:11434, that provider is auto-enabled and its model list is refreshed. Turning a local provider off in Settings records an opt-out, so Claudette will not re-enable it on the next launch. OpenAI API stays manual because it requires an API key and a remote account.

The data model also defines CustomAnthropic and CustomOpenAi kinds for self-hosted / proxied endpoints, but the Settings panel currently only renders the built-in backends — there is no in-GUI flow to add a custom provider yet.

Some Claude-specific features only have clean equivalents on particular backends. Claudette hides or disables unsupported controls instead of sending ignored settings.

  1. Open Settings > Models.
  2. Keep Agent providers on to show Ollama, OpenAI API, and custom providers.
  3. Keep Codex on to show Codex and seed Codex models into the picker.
  4. Configure each provider you want to use (URL, secret, models).
  5. Pick a default in Settings > Models > Default model, or override per session from the chat header.

When both provider gates are off, the built-in Anthropic harness remains exposed. Ollama, OpenAI API, custom backends, and native Codex stay hidden behind their respective gates.

ProviderKindDefault base URLAuthSetup
Claude CodeAnthropic(uses claude CLI)Inherits from Claude CodeAuthentication
OllamaOllamahttp://localhost:11434None (or optional bearer token)Ollama
OpenAI APIOpenAiApihttps://api.openai.comAPI key (required)OpenAI & Codex
CodexCodexNative(uses codex app-server)codex login (managed by codex CLI)OpenAI & Codex

Claudette splits providers into two architectural categories:

Direct Claude wire format (Anthropic, Ollama, CustomAnthropic) — speak Claude’s wire format natively and return errors with HTTP status codes the Anthropic SDK already classifies correctly. The spawned claude CLI just gets a different base URL and auth token; there is no in-process translation layer.

Gateway (OpenAiApi, CustomOpenAi, plus the legacy internal CodexSubscription path) — Claudette spawns a tiny in-process HTTP listener that the spawned claude process is pointed at instead of api.anthropic.com. The gateway does full Anthropic ↔ OpenAI /v1/responses translation in both directions, since these backends don’t speak Anthropic.

Native harness (CodexNative) — Claudette speaks to a purpose-built subprocess instead of spawning claude. Codex uses codex app-server --listen stdio://.

Heads up if you ever configure a custom OpenAI endpoint: Claudette posts to /v1/responses, not /v1/chat/completions. Providers that only implement Chat Completions won’t work behind the gateway.

The per-turn capabilities differ by provider (AgentBackendCapabilities in src/agent_backend.rs). The chat-header toggles for unsupported capabilities are hidden / disabled automatically:

CapabilityAnthropicOllamaGateway OpenAICodex
Extended thinking✅ (when model supports)✅ (reasoning summaries)
Reasoning / effort levels✅ (Claude effort)✅ (Codex intelligence)
Fast mode
1M-context auto-upgrade
Tool use
Vision

Codex exposes fast mode and Codex intelligence through Codex app-server settings. Switching a session to a provider visibly disables or relabels the toggles that don’t apply.

For gateway providers, Claudette spins up an HTTP listener on 127.0.0.1:0 (random port) per provider and per model. It mints a random auth token for that listener, then exports three env vars into the spawned claude subprocess:

  • ANTHROPIC_BASE_URL — the local gateway URL.
  • ANTHROPIC_AUTH_TOKEN — the auth token. Cached for the gateway server’s lifetime (keyed by backend id + runtime hash) and reused across turns; rotates only when the gateway restarts (e.g., after config or model changes).
  • CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1 — tells the CLI to query the gateway for available models.

The gateway translates Claude’s request into the OpenAI Responses API (POST /v1/responses for OpenAI; POST /codex/responses for the legacy Codex subscription path — the unversioned form is intentional, since the upstream Codex Responses endpoint lives directly under https://chatgpt.com/backend-api/codex/responses with no /v1/ segment) and translates the streaming response back. It’s an in-process tokio task; no external service.

If the provider config or model changes, the gateway restarts on the next agent turn. There’s no manual lifecycle to manage.

The model picker in the chat header is scoped to the active provider. Switching the provider resets the model to that provider’s default.

Per-session model selection is persisted in app_settings as model:<session_id> and model_provider:<session_id>. Disabling Agent providers triggers a cleanup pass: only sessions whose persisted model or provider was actually pointing at a non-Anthropic backend (or a non-built-in Claude model) get rewritten to the defaults anthropic / opus — sessions already on a built-in Claude model are left alone. The cleanup writes new values rather than deleting keys, and resets the live agent on rewritten sessions so the next turn starts fresh against Claude.

  • Default Claude Code (anthropic) — best feature parity. Keep this unless you have a specific reason to switch.
  • Ollama — air-gapped work, privacy-sensitive code, or offline travel. Quality varies wildly by model.
  • OpenAI API — if you specifically want gpt-* or OpenAI reasoning models, or have prepaid OpenAI credit you’d rather burn than your Claude quota.
  • Codex — if you’re already paying for ChatGPT Plus/Pro/Team and want to reuse that quota through the native Codex CLI.
  • The Anthropic-compatible providers should accept the full Claude Code request shape; not all proxies and self-hosted gateways implement everything (especially the system prompt format and tool-use protocol). If a provider silently drops fields, agents may behave oddly.
  • Gateway providers translate tool calls and vision payloads, but lossy edge cases exist around streaming partial messages. Test on a small turn before running long agent sessions on a new provider.
  • The Usage panel (Settings > Usage) only reads Anthropic subscription telemetry. Token consumption on other providers is whatever the upstream reports, not visible inside Claudette.