Providers and models¶
Authentication¶
For openai-codex: models, run /login openai-codex to sign in with your
ChatGPT account in the browser. No Codex CLI is required. Credentials are stored
in codex-credentials.json under $PCODE_CONFIG_DIR, otherwise
$XDG_CONFIG_HOME/pcode (default ~/.config/pcode);
PCODE_CODEX_CREDENTIALS_FILE overrides the full path. The file is owner-only,
and refreshed tokens are saved for later launches.
- pcode's own login wins. Without it, pcode reads the Codex CLI's
auth.jsonas a read-only fallback (CODEX_HOMEis honored); tokens refreshed from it stay in memory. A malformed pcode login is reported as an error rather than silently switching accounts. /logout openai-codexremoves only pcode's login, never the CLI's. New models then fall back to the CLI login if there is one; the active model keeps its cached token.- The browser callback uses fixed port 1455, so close other login flows using it
first. On a headless machine, run the Codex CLI's
codex login --device-authinstead. - This provider never falls back to
OPENAI_API_KEY. Which models you can use depends on your account. Authentication errors never show raw provider responses or credential values.
For ordinary OpenAI API models, use openai:<model-id> with OPENAI_API_KEY in
your environment. For Anthropic API models, use anthropic:<model-id> with
ANTHROPIC_API_KEY; to use a Claude subscription instead, pick a
Claude Code model. Use the exact model ID your account
offers; pcode does not remap aliases. Every provider in the table below works with the default install except
claude:, which needs the claude extra, and antigravity:, which needs the Antigravity CLI (agy).
Supported providers¶
Any provider:model-id string that Pydantic AI accepts works with --model and
/model. The model picker offers a provider when its variable below is set
(the value is never read). "Catalog" says whether the picker suggests model IDs
or only accepts IDs you type.
| Prefix | Enabled by | Catalog |
|---|---|---|
anthropic |
ANTHROPIC_API_KEY |
yes |
openai-codex |
pcode login, then CLI credential file (CODEX_HOME honored) |
yes (all OpenAI IDs) |
openai, openai-chat, openai-responses |
OPENAI_API_KEY |
yes |
claude |
Claude Code config (~/.claude, ~/.claude.json, or CLAUDE_CONFIG_DIR) or claude on PATH |
yes (Anthropic IDs) |
antigravity |
agy CLI on PATH (sign in with /login antigravity) |
yes (models offered by your Google AI Pro/Ultra subscription) |
google |
GOOGLE_API_KEY or GEMINI_API_KEY |
yes |
google-cloud |
GOOGLE_CLOUD_PROJECT or GOOGLE_APPLICATION_CREDENTIALS |
yes |
bedrock |
AWS_BEARER_TOKEN_BEDROCK, AWS_ACCESS_KEY_ID, or AWS_PROFILE |
yes |
bedrock-mantle |
AWS_BEARER_TOKEN_BEDROCK |
yes |
groq |
GROQ_API_KEY |
yes |
xai |
XAI_API_KEY |
yes |
deepseek |
DEEPSEEK_API_KEY |
yes |
cerebras |
CEREBRAS_API_KEY |
yes |
crusoe |
CRUSOE_API_KEY |
yes |
moonshotai |
MOONSHOTAI_API_KEY |
yes |
heroku |
HEROKU_INFERENCE_KEY |
yes |
snowflake |
SNOWFLAKE_TOKEN and SNOWFLAKE_ACCOUNT |
yes |
zai |
ZAI_API_KEY |
yes |
azure |
AZURE_OPENAI_API_KEY and AZURE_OPENAI_ENDPOINT |
typed IDs |
github-copilot |
GITHUB_COPILOT_API_KEY (or _TOKEN/COPILOT_GITHUB_TOKEN) and GITHUB_COPILOT_BASE_URL (or _API_BASE/COPILOT_API_URL) |
typed IDs |
openrouter |
OPENROUTER_API_KEY |
typed IDs |
vercel |
VERCEL_AI_GATEWAY_API_KEY or VERCEL_OIDC_TOKEN |
typed IDs |
fireworks |
FIREWORKS_API_KEY |
typed IDs |
together |
TOGETHER_API_KEY |
typed IDs |
nebius |
NEBIUS_API_KEY |
typed IDs |
ovhcloud |
OVHCLOUD_API_KEY |
typed IDs |
alibaba |
ALIBABA_API_KEY or DASHSCOPE_API_KEY |
typed IDs |
sambanova |
SAMBANOVA_API_KEY |
typed IDs |
ollama |
OLLAMA_BASE_URL |
typed IDs |
vllm |
VLLM_BASE_URL |
typed IDs |
The catalog is a static list of current models that comes with Pydantic AI, not
what your account is entitled to. Older or preview IDs dropped from it (such as
Gemini 2.5) still work when typed in full; Gemini before 3 searches the web
through pcode's own tools, since it can't mix Google Search with them. Providers not in the table (for example mistral, cohere, huggingface,
litellm) still work from --model once you install their Pydantic AI extra,
but the picker does not offer them. Apart from Codex, Claude Code, and Antigravity (/login antigravity), every
provider is plain API-key access with no login in pcode: set the variable in your shell before launching.
Choose a model in the terminal¶
Use /model or Ctrl+L to open the model picker. Type to filter, use ↑/↓ to
select, and press Enter to apply. Filtering matches provider and model names,
including joined word prefixes: anthopus finds Anthropic Opus, codluna finds
Codex Luna, and opus anth works too. Escape, Ctrl+C, or Ctrl+L closes the
picker without changing the model or your draft. For a model not listed, type its
full provider:model-id (for example anthropic:claude-opus-5).
The picker offers each provider in the supported providers
table whose credentials are configured, plus the current provider even with a
custom model ID. Opening it makes no network requests and never reads credential
contents: it only checks that a credential file exists or a variable is set.
PCODE_LLM_PROXY does not affect which models are offered.
Models are grouped by provider and family, newest version first (Opus 5 before Opus 4.8; 4.10 before 4.9), and filtering keeps that order. The current model is marked, not pinned to the top. Undated aliases come before dated snapshots of the same version.
Suggestions are not an entitlement list; the provider checks access when you use
the model. A typed provider:model-id is accepted for any supported provider,
configured or not, so you can export a key after launch. If no provider is
configured, run /login claude, /login openai-codex, or /login antigravity, or set
ANTHROPIC_API_KEY, first.
Changing models continues the current conversation. History, session ID,
plan, tool panel, usage totals, transcript, and draft are kept, and the saved
session records the new model so resuming uses it. Use /new to start over
instead. Selecting the current model does nothing, and a failed switch leaves the
conversation intact. Switching from the offline preview starts a live
conversation without restarting pcode.
The picker also works while a run or queued messages are active. Like
steering, the switch lands at the running turn's next request: the request in
flight finishes on the old model, and everything after it, including the rest of
that turn, uses the new one. /effort mid-run works the same way. A turn started
with $PROVIDER:MODEL or +EFFORT stays on its own model to the end. To switch
without waiting for the request in flight, cancel it with Ctrl+C and send again.
Saved model and effort defaults¶
A model chosen with /model becomes the default for future launches once the
selection takes effect. /effort and Ctrl+N/Ctrl+P save the effort for the
current model only, and also save that model as the default. Preferences live in
~/.config/pcode/preferences.json (or $XDG_CONFIG_HOME/pcode/preferences.json),
separate from saved conversations and unaffected by --no-save.
pcodewith no model argument reuses the saved model; with none saved it opens the offline preview.--theme-previewalways stays offline.- Saved effort applies per model, in new and resumed conversations. A model you
never set uses the
effortdefault./effort defaultrestores the provider default for the current model. -m/--modeloverrides the saved model for one launch, and--continueuses the session's model. Neither changes the saved default. Model and provider names are passed through as given.pcode config unset KEYresets one default.
Reasoning effort¶
For OpenAI/Codex, Anthropic, Claude Code, Gemini, and Antigravity models, Ctrl+N raises
effort and Ctrl+P lowers it; or use /effort low|medium|high|xhigh. /effort
alone shows the current setting and /effort default removes the override. Each
model remembers its own level. The footer shows the selected effort.
- Shortcuts stop at the lowest and highest levels. From the provider default they start at medium, so Ctrl+N selects high and Ctrl+P selects low.
- Changes apply from the next request, mid-turn too, and keep your draft.
- On OpenAI and Anthropic, effort does not change the model's thinking configuration. Not every model accepts every level; the provider still validates it.
- On Anthropic and Claude Code, only models that support effort accept
it (Opus 4.5+ and Sonnet 4.6+, among others). For any other model,
/effortrefuses a level and the footer shows no effort;/effort defaultstill clears a saved level.xhighbecomes Anthropic'smaxwhere the model has no nativexhigh. - On Gemini (
google:andgoogle-cloud:), effort sets the model's thinking level, matched to the nearest one it offers (Gemini 4 Neon has all four on the Gemini API;xhighishighon Vertex AI for now). Gemini models that don't think, such as Gemma, have no effort control. A Gemini level also returns thinking summaries, even with/show-thinking off;defaultleaves the level to the model. - On Antigravity (
antigravity:), effort sets the ACP session's thinking level, matched to the nearest one the model offers. Models Antigravity exposes without a thinking level have no effort control once seen. - The offline preview and other providers show no effort in the footer, and
n/ain/effortand/status.
Advisor¶
An advisor is a stronger model the session's model can consult before it commits to an approach, when it's stuck, or before it calls complex work done. Most of the work stays on the cheaper, faster model, and the expensive one only weighs in at the moments that matter. A good pairing is Opus 5.5 doing the work with Claude Fable 5.2 advising:
❯ /advisor anthropic:claude-fable-5-2
Advisor: anthropic:claude-fable-5-2 (next turn).
/advisoralone opens the model picker./advisor offremoves the advisor.- The choice carries across
/newand/resume, and the session remembers it, so resuming that session later (or moving it into a background host) brings it back. Resuming a session that picked its own advisor, or turned it off, switches to that choice, even if your saved default has changed since. Add--saveto make it the default for later launches too (/advisor anthropic:claude-fable-5-2 --save), or set it from the shell withpcode config set advisor_model anthropic:claude-fable-5-2./advisor off --saveclears the default. - Changes apply from the next turn. Adding or removing the advisor changes the model's tool list, so that turn starts without the prompt cache.
- The model decides when to consult. Ask for it in your prompt ("check with the advisor before you start") when you want it at a particular point.
/statusshows the advisor while one is set. Only the session's own model gets one; sub-agents and workflow workers don't. A/btwside question sees the same tools, to keep sharing the prompt cache, but is refused when it calls a separately run advisor. It can't be stopped from using Anthropic's built-in one.
How the advice is produced depends on the pairing:
- Anthropic API model advised by a Claude model (
anthropic:orclaude:name): Anthropic's own advisor tool runs inside the same request. The advisor reads the whole conversation, and its tokens are billed at its own rates. The newest advisors, Fable 5.2 among them, return their advice encrypted, so pcode can't show what it said. A Fable 5.2 or Mythos 5.2 session only accepts a 5.2 advisor this way; any other advisor uses the separate request below. - Every other pairing, including a Claude Code (
claude:) session: the advisor runs as a separate request on pcode's own login for that model, the way a/btwquestion on another model does. It sees only the question and context the session's model sends it, not the conversation.
/advisor refuses a name pcode can't use (an unknown provider, or one you aren't
signed in to) before anything changes, and a Claude name missing from the /model
catalog too, since Anthropic would fail every request over a name it doesn't know.
pcode config set advisor_model saves the name without checking it. A separately
run advisor is looked up again each turn, so after a /logout it's left out of
the turn instead of failing it.
Claude Code provider¶
A claude: model uses your Claude subscription through Claude Code's own login,
with no proxy to install or run:
pcode -m claude:claude-sonnet-5 # then /login claude if Claude Code is not signed in
The Claude Code CLI comes bundled, so you need neither Node.js nor a separate
claude install. Because the bundle is large (over 200 MB installed), it is the
optional claude extra. The Homebrew formula and make install include it;
elsewhere install pcode[claude], for example
uv tool install --python 3.15 --editable '.[claude]' from a checkout. Without it, claude:
models are left out of /model, and naming one tells you what to install.
pcode keeps one Claude Code process per conversation and runs every tool itself. A tool round does not start a new process. Anthropic provider options has the design and measurements.
Signing in¶
/login claude runs claude auth login in your browser and writes Claude Code's
usual login (CLAUDE_CONFIG_DIR is honored), so an existing Claude Code sign-in
already works. pcode never reads or stores the credential. A request that fails
because the login is missing or expired tells you to run /login claude.
To switch accounts, run /login claude again, even mid-turn, or run
claude auth login in another terminal (with the same CLAUDE_CONFIG_DIR, if you set one).
Claude Code rereads its login about every 30 seconds, so requests move to the new
account within half a minute, including the rest of a turn already running.
ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL, and Claude
Code's cloud routes (CLAUDE_CODE_USE_BEDROCK, CLAUDE_CODE_USE_VERTEX, and the
like) are cleared for claude: requests and /login claude. The key you use for
anthropic: models can never bill or redirect a claude: request.
What carries over¶
Conversations continue with a warm prompt cache after restarting pcode,
--continue, /tree, a retry, /btw, or a model or effort change. When the
history never went through Claude Code (you switched from another provider) or
was rewritten by compaction, the earlier conversation is replayed once, which
writes it to the cache again.
- Memory: each session runs a Claude Code process while a turn is in progress.
The first costs about 300 MB and each further one about 110–135 MB. After a turn
ends, each session keeps its process for ten minutes so the next turn starts
immediately (
claude_idle_processesandclaude_idle_minutes;0processes stops each one when its turn ends). A process waiting on tool results, such as a parent waiting for delegated tasks, is kept up to thirty minutes. When less than a tenth of the machine's memory is free, pcode stops idle processes within a minute. All of them stop when pcode exits. - Transcripts, tool output included, are stored in Claude Code's own store
(
~/.claude/projects/) and appear inclaude --resumefor the workspace. Your Claude Code settings are not loaded, so settings such ascleanupPeriodDaysdo not apply to these runs. - Use full model IDs such as
claude:claude-sonnet-5. An alias likeclaude:opusworks, but pcode cannot look up its context window, so setPCODE_CONTEXT_WINDOWfor compaction. pcode's output limit is passed on asCLAUDE_CODE_MAX_OUTPUT_TOKENS, capped at the model's maximum; for a model pcode has no limits for, Claude Code's default applies. - The model sees tool names as
mcp__pcode__<name>; pcode displays its own names. - Anthropic server tools are not available. Claude Code's own WebSearch and WebFetch take the place of web search and fetch (see web search); there is no code execution.
- Text pcode adds beside tool results (steering, MCP server notices) reaches the model as a message the user sent while it was working.
- Thinking is shown in summarized form.
Antigravity provider¶
An antigravity: model uses your Google AI Pro or Ultra subscription through
Google's Antigravity CLI:
pcode -m antigravity:gemini-4-neon
Install the Antigravity CLI and sign in
with /login antigravity (or agy acp --login in a terminal). antigravity: shows
up in /model whenever agy is on your PATH. The picker lists the models your
account offered the last time a session started.
This works differently from every other provider. pcode runs Google's own
agy acp server unmodified and acts only as its front end, which is the setup
Google permits for subscription use.
Antigravity runs the whole turn with its own tools, rules, and skills, and
pcode shows its tool calls, edits, and replies as they stream. That has a few
consequences:
- pcode's own coding tools aren't duplicated. Files, shell jobs, web
search, and plans stay on Antigravity's built-in versions. Everything that
belongs to pcode itself — delegation (
delegate_task,manage_worker,task_worktree),/advisor,/browser(bothlaunchandattach, including screenshots),session_history,conductor, spilled tool-output handles (read_tool_result,grep_tool_result), and any extension that setspcode.bridge_to_acp = True— is offered to Antigravity through pcode's ACP MCP server whenever enabled. - It can delegate to pcode workers on its own model or other providers. pcode
offers Antigravity its
delegate_task,manage_worker, andtask_worktreetools, so Antigravity can spin up a worker on its own current model (whenmodelis omitted), ask for a Claude reviewer or OpenAI second opinion, or call pcode'sbrowsersub-agent. Eachantigravity:worker runs in an isolatedagysession of its own; workers on other providers run in pcode with pcode's tools. Workers appear live in the task panel and in/agentswith their activity, plan, and transcript, just like workers started by any other model. A worker can run in the background (and long foreground workers automatically move to the background beforeagy's 3-minute MCP tool-call timeout): when it finishes, or asks a question, pcode tells Antigravity, which picks the work up again. - Other models can delegate to
antigravity:too. Passing anantigravity:model todelegate_task(or adding one tosubagent_models) runs that worker in its own isolatedagy acpsession. - pcode tells it what it tells any model. A finished background job, a
worker's result or question, and a message you queued all reach Antigravity
as prompts, and a finished job can wake it.
/continuesends "Continue." Switching to Antigravity with/modelmid-turn hands it the tool results the other model was waiting on, as text. - Side uses run in sessions of their own.
/btw, session titles, summaries, and an advisor on anantigravity:model each get a separateagy acpsession, so they run alongside a turn without touching the conversation's session./btwand delegatedantigravity:workers receive scoped pcode MCP tools (such as read-only session and host tools, without parent-only delegation or conductor controls); plain completions like titles and summaries run without bridged MCP tools. A/btwthread's follow-ups continue its side session. /compactand/autocompactuse Antigravity's own compaction. pcode sends its/compactcommand (before your prompt, once the context reaches the autocompact threshold), and Antigravity summarizes its own session. pcode's transcript is left as it is.- Antigravity runs without asking, as pcode's own tools do. pcode starts
it with
--dangerously-skip-permissions, since otherwise a background sub-agent's permission prompt never reaches pcode and the sub-agent stalls, and approves any prompt that still arrives one action at a time (never "always allow", so your Antigravity settings are left alone). pcode's own guardrails don't see Antigravity's tool calls. - Your API keys don't apply.
GEMINI_API_KEY,GOOGLE_API_KEY,GOOGLE_APPLICATION_CREDENTIALS, and everyGOOGLE_CLOUD_*,GOOGLE_GENAI_*,GOOGLE_VERTEX_*, andGOOGLE_GEMINI_*variable are removed from its environment, so a turn always bills the subscription you signed in with. - Prompts take text and images. Other attachments are refused.
- Messages you send while it works steer the running turn, as with other models: Antigravity folds each into the work in progress.
- Background work continues cleanly. When Antigravity leaves a shell command or schedule running across a turn, pcode holds the turn open until it finishes and its follow-up closes. If Antigravity wakes up later on its own (for example when a background sub-agent reports back, or after a brief quiet gap), pcode opens a continuation turn without prompting it so its tools, edits, bridged MCP calls, and reply stream normally instead of landing as post-turn notes.
- Plan mode is Antigravity's own.
/planswitches its session to its plan mode, where it writes a plan of its own (not pcode's plan file) and waits for your go-ahead; leaving plan mode in pcode switches it back.
Conversations carry over: each session keeps one agy process, a follow-up
continues it, and --continue reopens the same Antigravity session. After a
rewind, a branch in /tree, or a switch from another model, the conversation
is replayed to a new Antigravity session once, as text, since the old one
remembers turns your history no longer has. Interrupting a turn cancels it in
Antigravity too.
Model-only HTTP proxy¶
Set PCODE_LLM_PROXY to send Codex model requests, and only those, through an
HTTP proxy:
PCODE_LLM_PROXY=http://127.0.0.1:8080 pcode --model openai-codex:gpt-5.6-sol
- HTTP and HTTPS proxy URLs work (HTTPS traffic uses CONNECT). Unset or blank means no proxy.
- Only
openai-codex:models use it, including Codex token refresh and model calls from delegated workers. Other providers ignore it, so you can leave it set when switching providers. - The Codex client then ignores other proxy settings, including
NO_PROXY, and environment-based TLS configuration, so use a proxy that tunnels HTTPS without needing a custom CA from the environment. - Exa requests and shell commands keep their normal HTTP setup. pcode does not set
or change
HTTP_PROXY,HTTPS_PROXY, orALL_PROXY, so tools may still use those if they are set. - Keep proxy URLs that contain credentials out of prompts and diagnostics.