Chroxy runs AI coding sessions through pluggable providers. Each provider wraps a different AI backend behind the same WebSocket / event contract, so the mobile app and dashboard behave identically regardless of which one you pick. See Architecture for how providers fit into the session pipeline.

Built-in providers

  • claude-sdk (default) — Claude Code via the @anthropic-ai/claude-agent-sdk (in-process). Fastest startup, live model/mode switching, resume, and thinking-level control. The right choice for most users.
  • claude-cli — Legacy claude -p subprocess. Pick this when you need plan mode. Same billing as the SDK; permission handling routes through an HTTP hook.
  • claude-tui — Interactive claude TUI driven under a PTY. Bills against your Claude subscription’s interactive allowance instead of the programmatic credit pool. Trade-offs: no live streaming (one burst at turn end), no live model switch, no plan mode, no resume, no attachments, no cost reporting.
  • claude-channel (research preview, scaffold only) — will drive Claude through Anthropic’s first-party channels MCP protocol (claude --channels): subscription billing like claude-tui, but a documented protocol plus live streaming and a first-party permission relay. Not yet runnable — start() throws until the live bridge lands.
  • gemini — Google Gemini CLI (gemini -p). No permissions, no plan mode, no resume, no attachments.
  • codex — OpenAI Codex CLI (codex exec). No permissions, no plan mode, no resume, no attachments, no conversation continuity.
  • docker-cli / docker-sdk — containerized wrappers of claude-cli / claude-sdk. Register automatically only when environments.enabled=true and Docker is reachable. See Container Isolation.

Credentials

The default Claude provider uses your existing claude CLI login, so no extra setup is needed. Gemini and Codex require explicit keys:

ProviderEnv varWhere to get a key
Claude (default)ANTHROPIC_API_KEY (optional)https://console.anthropic.com/settings/keys
GeminiGEMINI_API_KEYhttps://aistudio.google.com/apikey
Codex (OpenAI)OPENAI_API_KEYhttps://platform.openai.com/api-keys

Keys can come from the shell environment, an inline prefix when starting the server, or the Settings → Provider Credentials pane in the dashboard. Dashboard-saved keys are written to ~/.chroxy/credentials.json (mode 0600, owner-only) and never shown again after saving. Resolution order is env > store > unset — an exported shell variable always wins.

Setting ANTHROPIC_API_KEY bypasses your Claude subscription’s programmatic credit pool and bills the raw API account directly. The Claude CLI/TUI providers deliberately strip ANTHROPIC_API_KEY from their spawn env so they keep using subscription / OAuth auth.

Choosing a Claude backend

Featureclaude-sdkclaude-cliclaude-tui
In-process permissionsYesNo (HTTP hook)No (HTTP hook)
Live model switchYesYes (restart)
Live permission-mode switchYesYes (restart)
Plan modeNoYesNo
ResumeYesNoNo
Thinking-level controlYesNoNo
Live streamingYesYesNo (deliver-on-complete)
AuthAPI key or claude loginAPI key or claude loginclaude login only
BillingProgrammatic credits / APIProgrammatic credits / APISubscription interactive allowance
Startup overheadNone (in-process)One subprocess spawn / sessionOne PTY warmup (~3.5s) / session
  • claude-sdk — default, most-featured, programmatic billing.
  • claude-cli — pick only when you need plan mode.
  • claude-tui — pick when you want sessions billed against your Claude.ai Pro / Max / Team subscription rather than the programmatic credit pool.

Capability matrix

Capabilityclaude-sdkclaude-cliclaude-tuicodexgemini
Permission handlingYes (in-process)Yes (HTTP hook)Yes (HTTP hook)
Live model switchYesYesYesYes
Live permission-mode switchYesYes
Plan modeYes
ResumeYes
Thinking-level controlYes
Live streamingYesYesNoYesYes
AttachmentsYesYes
Agent trackingYesYes
Cost reportingYesYes
Conversation continuityYesYesYesNoNo

A in a capability row means the provider reports false; in a behavioural row it means the feature is unimplemented. Most provider-agnostic UI (session tabs, dual chat/terminal view, push notifications, conversation search, dashboard) works across all providers.

Selecting a provider

Precedence, highest first: CLI flag > environment variable > config file > default (claude-sdk).

npx chroxy start --provider claude-cli
CHROXY_PROVIDER=gemini npx chroxy start
OPENAI_API_KEY=sk-... npx chroxy start --provider codex

Clients can also override the default per session by passing provider in a create_session WebSocket message. If a session is created for a provider whose key isn’t set, the server returns a clear error (e.g. “Codex: required credential not set — OPENAI_API_KEY”).

Billing note

The Claude SDK and claude -p paths count as programmatic usage, which draws from a separate monthly credit pool on Claude subscriptions rather than the interactive Claude Code allowance. Set ANTHROPIC_API_KEY to bill the raw API account directly, or use claude-tui to bill against the interactive subscription allowance. Prompt caching is on by default and typically cuts credit burn substantially on long sessions. See Configuration for CHROXY_COST_BUDGET and CHROXY_SESSION_TIMEOUT cost controls.

See also