~/.atomic/agent/auth.json or reads environment variables, and caches refreshed model catalogs in ~/.atomic/agent/models-store.json for offline use.
For a quick first-time walkthrough, see Authenticate a provider. For daily model switching, scopes, and fallbacks, see Choose a model. For credential precedence, stop reasons, and GitHub Copilot error classes, see Provider reference.
Before you begin
- Install Atomic (see Installation).
- Have an active subscription account, API key, or cloud identity ready for the provider you want to connect.
Subscriptions
Connect an existing subscription or account with/login inside Atomic, or with atomic auth login from your shell.
1
Start sign-in
Run
/login in an interactive session, choose Use a subscription (or Use an account for non-subscription OAuth such as OpenRouter), and select a provider. To jump straight to a provider, run /login <provider> (for example /login openrouter or /login kimi-coding).2
Complete browser or device-code sign-in
Follow the browser redirect or enter the displayed device code. Over SSH or on a remote host where a browser can’t reach localhost, paste the final redirect URL or authorization code into Atomic, or run
atomic auth login <provider> --no-browser from your shell.3
Confirm your session is ready
Run
/model to select a model from that provider, or run atomic auth check --provider <provider> from your terminal to confirm that it prints ready.- OpenRouter (account OAuth)
- OpenAI (Sign in with ChatGPT)
- ChatGPT Plus/Pro (Codex)
- Claude Pro/Max
- GitHub Copilot
- Kimi Code
- Meta (Muse subscription)
- xAI (Grok/X subscription)
/login, /logout, and their tab completions, marked with ✦. All other providers follow alphabetically. When a provider offers both account sign-in and an API key, Atomic prompts with Use a subscription (or Use an account) and Use an API key.
After you sign in, run /usage to see how much of each subscription you’ve used. See Check subscription usage.
To sign in from the shell without starting a session, run atomic auth login <provider>. Pass --no-browser for a device-code or non-browser flow (such as over SSH), or --api-key to store an API key without echoing it. See Credential commands.
Sign-in flows and sign-out follow these rules:
- Browser callback sign-in (OpenRouter, Claude, OpenAI, ChatGPT Codex, and compatible extension providers): Opens a browser sign-in page and listens on a local callback port. On remote or headless machines where the browser can’t reach localhost, paste the final redirect URL or authorization code into the prompt instead.
- Device-code sign-in (Kimi Code, GitHub Copilot, Meta, xAI, OpenAI Codex’s device-code option, and compatible extension providers): Displays the verification URL and code without opening a browser automatically. Press Enter to open the URL and copy the code, or open the URL manually and enter the code.
- Cancellation and errors: Pressing
EscorCtrl+Ccancels an in-progress sign-in quietly and leaves previously saved credentials and catalogs untouched. Provider denials, expired device codes, timeouts, network errors, and storage errors remain visible. - Sign out: Run
/logout [<provider>](oratomic auth logout <provider>from the shell) to remove stored credentials from~/.atomic/agent/auth.jsonand any legacy~/.pi/agent/auth.json. Atomic can’t clear environment variables, CLI flags, ormodels.jsonkeys; if one still authenticates the provider, the sign-out notice names it.
Token refresh
OAuth providers subtract a short expiry buffer (three to five minutes) when saving tokens. Atomic refreshes any stored OAuth token when fewer than 5 minutes of validity remain so long turns don’t start with an expiring token. Tokens outside that window stay untouched. Concurrent sessions sharingauth.json (including subagents) coordinate token refresh under a shared lock held for up to 2 minutes instead of rotating the same credential independently. Chat requests allow up to 15 seconds for pre-request authentication preparation, while catalog refreshes wait up to 60 seconds. If a refresh times out, the token exchange keeps running and saves its result when finished; retry the request instead of signing in again.
When Atomic exits normally (interactive quit, SIGTERM, ending an atomic -p run, or finishing an atomic auth command), it waits up to 3 seconds for an in-flight token exchange to save. If Atomic crashes or is force-stopped mid-refresh, run /login <provider> again.
Running sessions pick up auth.json updates made by another Atomic window, atomic auth, or another process’s refresh without restarting. If a chat request fails with HTTP 401 or a revoked-token error before any response arrives, Atomic rereads credentials and retries once if the effective credential changed; otherwise it names the provider and prompts you to run /login <provider>.
OpenAI API or ChatGPT sign-in
Run/login openai, then choose Use a subscription (Sign in with ChatGPT) or Use an API key. ChatGPT sign-in authenticates the openai provider against OpenAI’s Responses API; it is separate from /login openai-codex, which uses the Codex endpoint.
Complete the browser callback, or paste the final address-bar URL (including code, state, and client_id) into Atomic on a remote machine if your browser can’t reach 127.0.0.1:1455. Atomic creates a global device identity on first use that project settings don’t override. A saved sign-in doesn’t verify model entitlement or quota.
For SDK-level models.login() options such as agentName, see SDK login options and SDK API keys and OAuth.
Subscription and API key at the same time
openai and anthropic each store one credential, so a subscription sign-in replaces a stored API key. To use both side by side, configure the API-key-only providers openai-api and anthropic-api.
Both expose the same chat models and endpoints as openai and anthropic, reading OPENAI_API_KEY or ANTHROPIC_API_KEY unless you save a key with /login openai-api or /login anthropic-api. They never offer subscription sign-in, and anthropic-api ignores ANTHROPIC_OAUTH_TOKEN and ANTHROPIC_AUTH_TOKEN.
For example, sign in with ChatGPT under openai for interactive chat while pinning a subagent to openai-api/gpt-6.2-sol to bill your API key.
Two specialized OpenAI providers also skip ChatGPT sign-in and resolve keys in order (openai-api, openai API key, then OPENAI_API_KEY):
- OpenAI Decisions (
openai-decisions): Providesopenai-decisions/gpt-6-lunafor structured classification; see Use classifier models. - OpenAI Images (
openai-images): Provides GPT Image 1 through GPT Image 2.6 (including SVG and animated GIF generation on GPT Image 2.6); see Use image models. If you only signed in with ChatGPT, save a key with/login openai-apior setOPENAI_API_KEYto enable image generation.
OpenAI Codex
OpenAI Codex connects your ChatGPT Plus or Pro subscription to Atomic:- Officially endorsed by OpenAI: Codex for OSS.
- Supports both browser callback sign-in and a device-code flow (
--no-browser).
/logout, choose OpenAI ChatGPT Plus/Pro, then run /login again and retry. Atomic displays these steps with the error and never deletes stored credentials automatically.
For Codex requests, models.json headers or per-request SDK headers can override originator and User-Agent while Atomic continues supplying the bearer token and ChatGPT account ID.
Compare GPT-6.2 Astra, GPT-6.2 Sol, GPT-6 Astra, GPT-6.1 Sol, and GPT-6.1 Terra in OpenAI built-in models. GPT-6 Sol and GPT-6 Luna are also available as openai/gpt-6-sol, openai/gpt-6-luna, openai-codex/gpt-6-sol, and openai-codex/gpt-6-luna. Extension-registered provider aliases follow their own authentication method.
Fast and Ultrafast tiers
Atomic offers Fast and Ultrafast variants only for models that advertise them in Codex’s catalog or OpenAI’s published API pricing:- Fast (
service_tier: priority): Every Codex model except GPT-6.1 Terra, plusopenai/*models listed on OpenAI’s Fast pricing tab (for exampleopenai-codex/gpt-6.2-sol-fast:high). Models such asopenai/gpt-5-nanoandopenai/gpt-5-prohave no-fastvariant. - Ultrafast (
service_tier: "ultrafast"): GPT-6.2 Astra, GPT-6.2 Sol, GPT-6 Astra, and GPT-6.1 Sol (gpt-6.2-astra-ultrafast,gpt-6.2-sol-ultrafast,gpt-6-astra-ultrafast,gpt-6.1-sol-ultrafastunderopenai/,openai-api/, andopenai-codex/), plus limited-previewgpt-5.6-sol-ultrafastunderopenai/andopenai-api/.
- If OpenAI or Codex rejects a Fast or Ultrafast tier (such as
400 Invalid service_tier argument), Atomic retries once at the default tier and warns that the request ran at default. - With an API key, Atomic warns if OpenAI reports a slower tier than requested. With ChatGPT sign-in, it doesn’t warn because the ChatGPT service reports
defaulteven when serving Fast or Ultrafast. - Unadvertised tiers are omitted so requests run at standard processing instead of failing.
flexalways passes through; explicitdefaultomits the tier on Codex and sendsdefaulton the OpenAI API. - Usage is priced at the serving tier using OpenAI’s published per-model rates (Fast is typically 2x Standard; GPT-5.5 is 2.5x; GPT-4o is 1.7x; Ultrafast rates are listed in OpenAI built-in models). On ChatGPT sign-in, Codex counts Fast against included limits at 2.5x and Astra Ultrafast at 8x, and bills purchased credits at 2x and 6x.
Claude Pro/Max
Anthropic subscription authentication works with Claude Pro/Max accounts. Third-party usage draws from extra usage and bills per token rather than against Claude plan limits. Run/login anthropic and choose Use a subscription. Browser login (default) uses a local callback on port 53692 (falling back to a free port) and accepts a pasted redirect URL. When your browser runs on another machine, choose Copy code login (headless), then paste the displayed code#state value into Atomic.
When configuring Anthropic with environment variables instead of /login, Atomic checks credentials in the following order (empty variables count as unset; avoid setting both ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY accidentally):
- Stored
auth.jsoncredential (subscription or saved API key) ANTHROPIC_AUTH_TOKEN(gateway-issued bearer token sent asAuthorization: Bearer ...without synthesizingx-api-key)ANTHROPIC_OAUTH_TOKENANTHROPIC_API_KEY- Anthropic workload identity federation
anthropic/claude-opus-5-5, default), Claude Sonnet 5.5 (anthropic/claude-sonnet-5-5), Claude Haiku 5.5 (anthropic/claude-haiku-5-5), Claude Opus 5 (anthropic/claude-opus-5), and Claude Fable 5.2 (anthropic/claude-fable-5-2, $8 input / $40 output per million tokens, 1M context, 128K max output). Both Fable 5.1 and Fable 5.2 support per-message effort and mid-conversation system messages and restrict server-side fallback to Claude Opus 5.
On supported models connected directly to Anthropic, Atomic displays progress updates before tool calls instead of requesting reasoning summaries. No setup change is needed. See Claude progress updates and reasoning summaries for the supported models and how to switch back to reasoning summaries.
GitHub Copilot
Connect GitHub Copilot with OAuth or a personal access token:- Run
/login github-copilotand press Enter forgithub.comor enter your GitHub Enterprise Server domain. - Personal access tokens also work: save one with
/login github-copilot(Use an API key) or exportCOPILOT_GITHUB_TOKEN(a stored key takes precedence). - If Copilot returns
"model not supported", enable the model in VS Code under Copilot Chat’s model selector, then run/loginoratomic update --models.
gpt-6.2-astra, gpt-6.2-sol, gpt-6.1-sol, gpt-6.1-terra, gpt-6-astra), Gemini 3.8 and 4, Kimi K3, Grok 4.5–4.7, and Claude—plus any additional chat models your account advertises on its /models endpoint. Atomic refreshes your account’s model list at interactive startup, in /model, and with atomic update --models, caching it in models-store.json for offline and atomic -p runs.
Discovered account models keep their advertised IDs unchanged, inherit account-reported limits, vision settings, and reasoning efforts (adjustable with modelOverrides), omit 24-hour prompt-cache retention by default, never overwrite built-in entries, and skip models disabled by policy or lacking tool-call support. Copilot fast models appear only when advertised by your account.
Which models are shown
After Atomic reads your account’s/models list using an OAuth sign-in or saved API key, built-in Copilot models absent from that list are hidden across /model, --list-models, scoped models, and model cycling. Each saved credential and extension provider alias maintains its own filter list so accounts never mix models.
Atomic never hides models on a guess:
- Before the first successful refresh (such as an offline first start), the full built-in catalog and any cached models remain visible.
- If a refresh fails offline or with
HTTP 401, earlier saved lists stay intact and nothing is hidden. - Models defined in
models.jsonare never hidden. - Tokens supplied only with
COPILOT_GITHUB_TOKEN,--api-key, environment-variable references, or shell commands don’t maintain saved filter lists; save the token with/login github-copilot(Use an API key) to enable per-account filtering.
Model families
Built-in entries use the API declared in Atomic’s catalog; discovered models automatically select the highest-priority endpoint Atomic supports from your account’s listing (Messages, Responses, then Chat Completions). The following table summarizes the bundled multi-vendor families on GitHub Copilot:
All built-in entries in the preceding table accept images (discovered models read vision flags and image limits from your account listing), support parallel tool calls and strict tool schemas where advertised, count reasoning tokens toward output tokens, compact on prompts rejected under the nominal context window, and retry empty responses.
Errors
Atomic classifies every failed Copilot request into one of 11 typed error classes so retries and model fallback react to the failure cause rather than message text:- Immediate fallback (no retry): unavailable model, exhausted quota, invalid request, or authentication failure.
- Retry, then fallback: rate limit (honors
Retry-After), service unavailable (408,5xx, or529), cut stream, empty response, or unrecognized response. - Compaction (no fallback): prompt exceeds the model’s prompt-token limit (or
HTTP 413). - Content filter: retries or falls back according to
retry.fallbackOnContentFilter.
Streams cut after a long attempt
Astream-ended-early error reports the Copilot request ID (x-request-id), attempt duration, and whether any response content arrived before the cut, as shown in the following example (wrapped for readability):
- A long cut gets at most one more retry on the same model; shorter cuts keep the normal
retry.maxRetriesbudget. - A second consecutive long cut stops retrying that model and moves to
fallbackModels(which can include the same model at a lower effort, such asgithub-copilot/claude-opus-5.5:medium), or ends with the error. - Partial output from a cut stream is never replayed; every retry restarts the turn.
Responses that end without a finish reason
Copilot occasionally closes a Chat Completions stream cleanly without a finish reason (commonly on Gemini models). Because an abnormally cut stream never sendsdata: [DONE], Atomic uses [DONE] to distinguish normal completion from a cut stream: complete tool calls finish as toolUse, text finishes as stop, empty responses fail as empty-response and retry, and incomplete tool calls or streams ending without [DONE] fail as stream-ended-early. When Atomic infers the stop reason, the raw provider stop reason stays unset and an inferred stop-reason diagnostic appears in /debug and session exports.
Endpoint routing for personal access tokens
OAuth sign-ins receive their Copilot host from GitHub’s token exchange. Personal access tokens (saved with/login as an API key or set in COPILOT_GITHUB_TOKEN) resolve their host in the following order:
COPILOT_API_TARGET, thenGITHUB_COPILOT_BASE_URL(explicit host or full URL)- The
proxy-ep=segment embedded in the token GITHUB_SERVER_URL:<tenant>.ghe.comroutes tocopilot-api.<tenant>.ghe.com; other non-github.comhosts route tohttps://api.enterprise.githubcopilot.comhttps://api.githubcopilot.com(public routing hub)
models.json baseUrl for github-copilot overrides all of the preceding rules. Raw tokens (github_pat_, ghp_, gho_, ghu_) send Copilot-Integration-Id: copilot-developer-cli unless overridden in headers (such as vscode-chat). Business and enterprise tokens sent to the individual host return 421 Misdirected Request; to fix it, set COPILOT_API_TARGET to your organization’s Copilot host.
xAI (Grok/X subscription)
Run/login xai, then select Use a subscription to start the device-code sign-in flow. XAI_API_KEY remains available through Use an API key.
Atomic defaults xAI sessions to grok-4.7. xai/grok-4.7-fast and other xai/*-fast choices request xAI Priority Processing, billed at twice standard token rates only when the response confirms priority processing (fallback to default processing bills at standard rates).
Meta (Muse subscription)
Run/login meta, then choose Use a subscription to start the device authorization flow. The sign-in mints a Model API key that refreshes automatically about once a day. META_API_KEY remains available through Use an API key.
OpenRouter
Authenticate with/login openrouter (Use an account or Use an API key) or OPENROUTER_API_KEY.
With a key configured, Atomic queries OpenRouter’s /models/user endpoint and lists only the chat models that key can access, with your key’s context window, max output, and pricing (image and classifier models aren’t filtered). Atomic caches this list for offline, atomic -p, and remote procedure call (RPC) runs; saved sessions still restore models omitted by the current key.
To route through a regional endpoint, override baseUrl in models.json:
/models/user rejects the key or doesn’t exist on a custom proxy URL, Atomic falls back to listing all OpenRouter models.
Fast models
Fast inference is a selectable model ID, not a setting. When a provider enables fast mode through a request parameter (OpenAI and xAIservice_tier, Anthropic speed), Atomic derives a <model-id>-fast (and eligible <model-id>-ultrafast) variant that sends the base model ID with that tier parameter. When a provider publishes fast models under their own IDs (GitHub Copilot), Atomic exposes those exact IDs without derivation.
Fast models appear alongside their normal siblings in /model and atomic --list-models and work with thinking suffixes such as anthropic/claude-opus-5-fast:high.
The following table lists every provider path that derives fast variants:
Keep these fast-variant rules in mind:
- Eligibility and proxies: Custom provider IDs (including proxy providers registered under a custom name), Azure, Bedrock, Vertex, OpenRouter, Vercel AI Gateway, generic OpenAI- or Anthropic-compatible providers, and providers with a custom extension
streamSimplehandler never receive derived-fastvariants. Overriding onlybaseUrlon built-inopenai,openai-api,openai-codex,anthropic,anthropic-api, orxaipreserves their derived variants. - Canonical IDs and collisions: Atomic persists and displays the
-fastor-ultrafastID in sessions, usage, fallbacks, and subagents. Fast routing never comes from a name suffix alone: if a provider,models.json, or an extension defines that exact ID, your definition wins and startup warns about the collision. Provider-owned IDs such as Vercel AI Gateway’sopenai/gpt-6-astra-fastor OpenRouter’sopenai/gpt-6-astra-proremain ordinary catalog IDs with their own rates. - Extension hooks: A derived fast variant locks its upstream model ID and tier field (
service_tierorspeed). Extension request hooks (before_provider_request, see Extension events) can edit other fields, but altering either locked field or returning a non-object fails the request. - Subagents: Choose fast variants deliberately for subagents, because parallel runs multiply token usage at priority rates.
API keys
Configure pay-per-token API keys through environment variables or~/.atomic/agent/auth.json.
Environment variables or auth file
Run/login and choose Use an API key to store a key in ~/.atomic/agent/auth.json, or export an environment variable before starting Atomic:
API_KEY: your provider API key.
--api-key > auth.json > extension or models.json apiKey > built-in environment variable), see Credential resolution order. For non-provider variables, see Environment variables.
The following table lists every built-in provider’s environment variable and auth.json key:
Note these provider-specific behaviors:
- Z.AI and Baseten: Z.AI and Z.AI Coding Plan (China) default to
glm-5.3and also expose multimodalglm-5.3-flash. Baseten defaults tozai-org/GLM-5.3and exposeszai-org/GLM-5.3-Fastandzai-org/GLM-5.3-Flash. GLM-5.3 entries supportlow,high, andmaxreasoning (notoff); useGLM-5.2when disabled reasoning is required. - Qwen Token Plan: Separate Team and Individual providers exist per region, all defaulting to
qwen3.8-max. LegacyQWEN_TOKEN_PLAN_API_KEYandQWEN_TOKEN_PLAN_CN_API_KEYstill work as fallbacks. - Xiaomi MiMo: Reasoning models on
xiaomiandxiaomi-token-plan-*support onlyoffandhigh. - Kimi For Coding: Uses OpenAI Chat Completions at
https://api.kimi.com/coding/v1(include/v1if overridingbaseUrlinmodels.json). Kimi Code models always think, sooffisn’t selectable.
atomic --list-models to inspect the catalog for any configured provider.
Auth file
Store credentials in~/.atomic/agent/auth.json (written with owner-only 0600 permissions; Atomic also reads legacy ~/.pi/agent/auth.json as a fallback):
ANTHROPIC_API_KEY_VALUE: your Anthropic API key (or an$ENV_VARreference, as shown for DeepSeek).OPENAI_API_KEY_VALUE: your OpenAI API key.OPENROUTER_API_KEY_VALUE: your OpenRouter API key.
env map whose values override process environment variables when resolving keys, headers, cloud settings (Cloudflare, Azure, Vertex, Bedrock), cache retention, and HTTP_PROXY / HTTPS_PROXY:
API_KEY: your Cloudflare API token.ACCOUNT_ID: your Cloudflare account ID.GATEWAY_ID: your Cloudflare AI Gateway slug.
key value supports literal strings, environment interpolation ("$ENV_VAR" or "${ENV_VAR}", with $$ and $! escapes for literal $ and !), and shell commands ("!op read 'op://vault/item/credential'"). In auth.json, !command results (including failures) are cached for the lifetime of the process—restart Atomic if a password-manager prompt fails once—whereas !command in models.json runs uncached on every request. See Value resolution for full syntax, timeout, and redaction rules.
Cloud and enterprise providers
The following providers support cloud identity chains, enterprise gateways, or extra account parameters.Anthropic workload identity federation
When no Anthropic API key, bearer token, or subscription sign-in is configured, Atomic enables workload identity federation ifANTHROPIC_FEDERATION_RULE_ID, ANTHROPIC_ORGANIZATION_ID, and ANTHROPIC_IDENTITY_TOKEN_FILE are all set.
The Anthropic SDK exchanges the identity token for a short-lived access token and rereads the token file on each refresh, so keep that file updated during long sessions. ANTHROPIC_SERVICE_ACCOUNT_ID and ANTHROPIC_WORKSPACE_ID are sent when set. API keys, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_OAUTH_TOKEN, and custom authorization headers take precedence over federation. Federation applies only to the anthropic provider.
NVIDIA NIM
NVIDIA NIM defaults tonvidia/nemotron-3.5-super-vl-120b-a12b when selected automatically. To launch a session on that model explicitly, run:
--list-models or /model to inspect the catalog; a catalog listing doesn’t verify account access or serving availability.
Azure
Use theazure provider for Azure OpenAI Responses models and Microsoft Foundry Chat Completions models (including azure/deepseek-v4-pro, which supports low, medium, and high reasoning). Export your Azure key and endpoint before starting Atomic:
API_KEY: your Azure OpenAI API key.RESOURCE_NAME: your Azure resource name.GPT4_DEPLOYMENT: your Azure deployment name forgpt-4, if it differs from the model ID.GPT4O_DEPLOYMENT: your Azure deployment name forgpt-4o, if it differs from the model ID.
/openai/v1. AZURE_OPENAI_API_VERSION applies to Responses requests (default v1), and AZURE_OPENAI_DEPLOYMENT_NAME_MAP maps model IDs to custom Azure deployment names across both APIs without changing session display IDs.
Custom Azure models in models.json default to azure-openai-responses; set "api": "openai-completions" for unlisted Foundry Chat Completions deployments. Startup automatically migrates the legacy provider ID azure-openai-responses to azure.
Amazon Bedrock
Run/login amazon-bedrock to walk through Bedrock’s guided setup (Bearer token, AWS profile, or Existing AWS credential chain), or export AWS credentials directly in your shell:
PROFILE_NAME: your named AWS profile from~/.aws/config.ACCESS_KEY_ID: your AWS Identity and Access Management (IAM) access key ID.SECRET_ACCESS_KEY: your AWS IAM secret access key.SESSION_TOKEN: your temporary AWS IAM session token (omitAWS_SESSION_TOKENfor permanent keys).BEARER_TOKEN: your Amazon Bedrock bearer token.
AWS_CONTAINER_CREDENTIALS_*) and IAM Roles for Service Accounts (IRSA, AWS_WEB_IDENTITY_TOKEN_FILE) also work.
Bedrock credential precedence: A bearer token saved in
auth.json takes highest priority. If no bearer token key is saved in auth.json, an ambient AWS_BEARER_TOKEN_BEDROCK environment variable takes precedence over an AWS_PROFILE saved in auth.json.- Bedrock GPT-6 models: Bedrock exposes
gpt-6.2-astra,gpt-6.2-sol,gpt-6.1-sol,gpt-6.1-terra,gpt-6-astra,gpt-6-sol, andgpt-6-lunaas directopenai.*IDs plusglobal.openai.*andus.openai.*inference profiles, with no Fast or Ultrafast variant. See OpenAI built-in models for per-profile pricing and reasoning effort support. - Application inference profiles and caching: Prompt caching turns on automatically when a Claude model ID contains a recognizable model name. For application inference profile Amazon Resource Names (ARNs) that omit the model name, export
AWS_BEDROCK_FORCE_CACHE=1(and give custom GPT inference profiles a recognizable GPT name inmodels.jsonso reasoning effort is sent). - Bedrock API proxies: Set
AWS_ENDPOINT_URL_BEDROCK_RUNTIME=https://bedrock-proxy.example.com/bedrock. If the proxy handles signing, setAWS_BEDROCK_SKIP_AUTH=1. If your proxy doesn’t support HTTP/2, setAWS_BEDROCK_FORCE_HTTP1=1. - Bedrock retries: Leaving
retry.provider.maxRetriesunset keeps the AWS retry count. Bedrock still stops retrying when a rate limit or server error specifies a wait longer thanretry.provider.maxRetryDelayMs(60 seconds by default), so chat can use the next eligible fallback. See Retry for settings and examples.
Cloudflare AI Gateway
SaveCLOUDFLARE_API_KEY with /login or export it alongside your account ID and gateway slug before launching Atomic:
API_KEY: your Cloudflare API token.ACCOUNT_ID: your Cloudflare account ID.GATEWAY_ID: the AI Gateway slug created in the Cloudflare dashboard under AI > AI Gateway.
/compat with workers-ai/@cf/... IDs), OpenAI (/openai), and Anthropic (/anthropic). Gateway authentication sends CLOUDFLARE_API_KEY in cf-aig-authorization; prefer unified billing or stored bring your own key (BYOK) in the Cloudflare dashboard over inline BYOK (which requires adding an upstream Authorization header in models.json).
Cloudflare Workers AI binding (no API token): Inside a Cloudflare Worker in the gateway’s account, bind env.AI in wrangler.toml ([ai]\nbinding = "AI" plus CLOUDFLARE_GATEWAY_ID) and override cloudflare-ai-gateway through atomic.registerProvider() using createGatewayBindingFetch({ binding: env.AI }) and CLOUDFLARE_GATEWAY_BINDING_AUTH_SENTINEL exported from @bastani/atomic:
createGatewayBindingFetch requires a binding exposing fetch() (bindings with only gateway(id).run(...) aren’t supported) and forwards requests untouched to ${bindingPrefix}/{provider}/.... Swap in openai-completions or openai-responses targeting ${bindingPrefix}/compat or ${bindingPrefix}/openai for other routes. See TypeScript SDK and Override a built-in provider.
Cloudflare Workers AI
SaveCLOUDFLARE_API_KEY with /login or export it alongside CLOUDFLARE_ACCOUNT_ID:
API_KEY: your Cloudflare API token.ACCOUNT_ID: your Cloudflare account ID.
x-session-affinity automatically for prefix caching. Workers AI also includes built-in classifiers using the same credentials: Cloudflare Clef (@cf/cloudflare/clef, @cf/cloudflare/clef-flash, @cf/cloudflare/clef-omni, up to four PNG, JPEG, or WebP images) and TypeSafe Jev (typesafe/jev, typesafe/jev-1.14.0, PNG or JPEG images). See Use classifier models.
Google Vertex AI
Run/login google-vertex to configure a Google Cloud API key, Application Default Credentials, or a Service account credentials file, or export environment variables directly:
PROJECT_ID: your Google Cloud project ID.SERVICE_ACCOUNT_KEY_PATH: the absolute path to your service account JSON key file.API_KEY: your Google Cloud API key.
Specialized providers
Classifiers, image models, and remote compactors never appear in/model and never run as your chat model.
Gemini Decisions
google-decisions/gemini-decision-1 uses Google’s Gemini Decisions API to answer yes/no, choice, and score questions about text and images. It is a classifier, not a chat model.
Gemini Decisions hasn’t been confirmed against the live API yet; report problems on #6788.
-
If you already saved a Gemini key with
/login google, reuse it. Otherwise, get a Gemini API key from Google AI Studio, then run/login googleor setGEMINI_API_KEY(orGOOGLE_API_KEY) before starting Atomic. Atomic checks the savedgooglekey first, thenGEMINI_API_KEY, thenGOOGLE_API_KEY. There is no/login google-decisionsentry, and the API isn’t available through Vertex AI. -
Open
/settings→ Decision model and choosegoogle-decisions/gemini-decision-1(applies immediately without/reload), or add the following setting tosettings.jsonand run/reload:
/settings (or set decisionModel to "") to clear it. To use Gemini only for individual requests, leave decisionModel unset and pass the model directly. In codemode, get the model with models.getModelOfType("classifier", "google-decisions", "gemini-decision-1") and pass it to models.classify().
Limits: Each request can contain 1 to 1,000 questions. Choice questions need 2 to 255 options; score questions need 2 to 255 levels. Google checks the 262,144-token limit across the input and all questions. Atomic sends images inline and caps the encoded request at 100 MB. See Google’s supported image formats and request limits.
The following table maps common Gemini Decisions errors to recommended actions:
Structured decisions try the next eligible candidate or the current chat model when fallback is allowed. Chat fallback doesn’t return probabilities. Direct codemode calls report the failure instead of choosing another model. See Structured decision limits.
TypeSafe Jev
typesafe/jev-latest and typesafe/jev-1.14.0 are Atomic’s direct TypeSafe classifiers. Save your key with /login typesafe or set TYPESAFE_API_KEY (stored credentials take precedence).
Keep these rules in mind when using TypeSafe Jev:
- Selection: Choose a registered classifier in
decisionModel(/settings→ Decision model, switches live without/reload), or pass it directly tostructured_outputorgenerateStructuredOutput().decisionModelis unset by default and raises an error on first decision use until configured; saving TypeSafe credentials never selects a decision model automatically. Compaction never uses classifiers—acompactionModelnaming one resets to"auto"(see Select a compaction model). - Context and images: Direct TypeSafe classifiers support up to 262K tokens (requests larger than TypeSafe’s default 64K window are slower and less accurate) and PNG or JPEG images (280 to 1,568 px per side). Atomic attaches images under an
imagesarray on the state; states that already defineimagescan’t attach images. - Gateway Jev: Atomic also registers Jev classifiers on OpenRouter (
openrouter/~typesafe/jev-latest,typesafe/jev-1.13,typesafe/jev-1.14, 262K with images), Vercel AI Gateway (vercel-ai-gateway/typesafe-ai/jev,jev-1.13.0,jev-1.14.0, 32K text only), and OpenCode Zen (opencode/jev-1.13,jev-1.13-free, 32K text only). - Failures and fallback: Classifier candidates are skipped when a schema isn’t a finite Choice. Missing credentials, size rejections, refusals, or malformed classifier output fall back to your chat model or next candidate (
HTTP 401indicates an invalid key,HTTP 422a contract error,HTTP 429or529a rate limit or overload). See Structured decision limits.
llama.cpp) and image models (openai-images, openrouter), see Use classifier models and Use image models.
Morph compaction
Run/login morph to store a Morph API key in ~/.atomic/agent/auth.json, or export MORPH_API_KEY (stored credentials take precedence).
Select morph/morph-compactor (or any custom remote compactor) under /settings → Compaction model (switches live without /reload), or set "compactionModel": "morph/morph-compactor" in settings.json. Customize parameters such as compression_ratio or preserve_recent with modelOverrides in ~/.atomic/agent/models.json; see Configure Morph or add a custom compactor.
During compaction, Morph receives the conversation without thinking blocks and returns a replacement summary while the agent retains verbatim session history for recovery. Use Morph only if your policy permits sending conversation content to Morph. Missing credentials, HTTP errors, timeouts, or unusable output automatically fall back to memory compaction (see Custom compaction models).
Local and custom providers
Use local or custom providers when you run models on your own hardware, connect through an internal proxy, or build a custom protocol.llama.cpp
Connect Atomic to a localllama.cpp router server with /login llama.cpp or LLAMA_BASE_URL and manage local GGUF models with /llama. See Run local models with llama.cpp.
Custom providers
Choose between static configuration and TypeScript extensions:- With
models.json: Add Ollama, LM Studio, vLLM, API proxies, or custom remote compactors using OpenAI Completions, OpenAI Responses, Anthropic Messages, or Google Generative AI. See Configure custom models. - With extensions: Implement custom streaming, image, classifier, or compactor APIs, dynamic model discovery, or OAuth flows. See Build custom providers and the GitLab Duo custom provider example.
Verify credentials before a session
Runatomic auth check to verify effective credentials in continuous integration (CI), scripts, or before launching a session:
- Status and exit codes: Prints
ready(exit0),not_ready(exit1), orinvalid(exit2). - JSON output (
--json): Returns{ status, provider, authType?, reason?, credentials? }. Possiblereasonvalues areprovider_not_found,credentials_not_configured,credential_expired,credential_not_available, andinvalid_state. - OAuth refresh versus read-only probe: Checks refresh expired OAuth tokens by default through the locked
auth.jsonpath. Pass--no-refreshfor a read-only check that never creates, locks, or writes files. - Opt-in credential export (
--credentials): Readiness output omits secret values by default. Pass--credentialswith--provideror an exact--modelto emit the resolved credential on stdout (or in JSONcredentials); OAuth exports require at least 30 minutes of remaining lifetime when--no-refreshprevents a refresh. Non-ready and invalid statuses write to stderr so stdout stays empty—except exit9, which reports a partial write to stdout (discard those bytes; exit8means nothing was written).
atomic auth print-api-key --model <model> or atomic auth print-bearer-token --model <model> [--min-expiry <duration>] (defaults to 30m). See CLI credential commands and Security: credential export.
Troubleshooting
Use these checks for common sign-in and credential issues:421 Misdirected Requeston GitHub Copilot: A business or enterprise personal access token was routed to the individual Copilot host. ExportCOPILOT_API_TARGETset to your organization’s Copilot host.HTTP 401or revoked OAuth token: If another window didn’t already refresh the token, run/logout <provider>, then/login <provider>to save a fresh sign-in.- Password-manager
!commandinauth.jsonkeeps failing after unlocking your vault:auth.jsoncaches!commandresults (including failures) for the process lifetime. Restart Atomic after unlocking the vault. - Browser callback fails over SSH: Paste the final redirect URL or authorization code into the
/loginprompt, or runatomic auth login <provider> --no-browserfrom your terminal. - Provider still authenticated after
/logout:/logoutremoves only entries inauth.json. Unset the environment variable or remove themodels.jsonapiKeynamed in the sign-out notice.
Next steps
Choose a model
Switch models and thinking levels, scope models, set fallbacks, and troubleshoot selection.
Run local models with llama.cpp
Connect a local llama.cpp router server for local chat models and classifiers.
Configure custom models
Add Ollama, vLLM, proxies, image models, classifiers, and remote compactors.
Provider reference
Credential precedence order, normalized stop reasons, and GitHub Copilot error classes.