Skip to main content
Use this guide to sign in to subscription providers, save API keys, configure cloud and specialized providers, and verify credentials before starting a session. Atomic stores credentials in ~/.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.
The following providers support interactive subscription or account sign-in:
  • 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)
OpenRouter, Atomic’s preferred partner, appears first in /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 Esc or Ctrl+C cancels 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>] (or atomic auth logout <provider> from the shell) to remove stored credentials from ~/.atomic/agent/auth.json and any legacy ~/.pi/agent/auth.json. Atomic can’t clear environment variables, CLI flags, or models.json keys; if one still authenticates the provider, the sign-out notice names it.
Built-in and extension-provided OAuth work in interactive and non-interactive sessions. Sign-in finishes after credentials are saved; catalog refresh runs separately in the background.

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 sharing auth.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): Provides openai-decisions/gpt-6-luna for 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-api or set OPENAI_API_KEY to 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).
If Codex reports an invalidated or revoked token and no newer sign-in exists, run /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, plus openai/* models listed on OpenAI’s Fast pricing tab (for example openai-codex/gpt-6.2-sol-fast:high). Models such as openai/gpt-5-nano and openai/gpt-5-pro have no -fast variant.
  • 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-ultrafast under openai/, openai-api/, and openai-codex/), plus limited-preview gpt-5.6-sol-ultrafast under openai/ and openai-api/.
Ultrafast requires an eligible plan (Pro $500 or an eligible Enterprise/Edu workspace with ChatGPT sign-in, or Pro $200 for GPT-6.2 Sol; available at low default rate limits with an API key). Keep these request and billing rules in mind:
  • 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 default even when serving Fast or Ultrafast.
  • Unadvertised tiers are omitted so requests run at standard processing instead of failing. flex always passes through; explicit default omits the tier on Codex and sends default on 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):
  1. Stored auth.json credential (subscription or saved API key)
  2. ANTHROPIC_AUTH_TOKEN (gateway-issued bearer token sent as Authorization: Bearer ... without synthesizing x-api-key)
  3. ANTHROPIC_OAUTH_TOKEN
  4. ANTHROPIC_API_KEY
  5. Anthropic workload identity federation
The Anthropic catalog includes Claude Opus 5.5 (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-copilot and press Enter for github.com or enter your GitHub Enterprise Server domain.
  • Personal access tokens also work: save one with /login github-copilot (Use an API key) or export COPILOT_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 /login or atomic update --models.
Copilot serves models from multiple vendors—including OpenAI GPT-6 (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.json are 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, or 529), 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.
For SDK error inspection helpers, see Provider errors.

Streams cut after a long attempt

A stream-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):
Streams cut during long thinking or large tool calls often fail at the same point on retry. Atomic treats any attempt that ran 5 minutes or more before cutting off as a long attempt:
  • A long cut gets at most one more retry on the same model; shorter cuts keep the normal retry.maxRetries budget.
  • A second consecutive long cut stops retrying that model and moves to fallbackModels (which can include the same model at a lower effort, such as github-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 sends data: [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:
  1. COPILOT_API_TARGET, then GITHUB_COPILOT_BASE_URL (explicit host or full URL)
  2. The proxy-ep= segment embedded in the token
  3. GITHUB_SERVER_URL: <tenant>.ghe.com routes to copilot-api.<tenant>.ghe.com; other non-github.com hosts route to https://api.enterprise.githubcopilot.com
  4. https://api.githubcopilot.com (public routing hub)
A 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:
If /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 xAI service_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 streamSimple handler never receive derived -fast variants. Overriding only baseUrl on built-in openai, openai-api, openai-codex, anthropic, anthropic-api, or xai preserves their derived variants.
  • Canonical IDs and collisions: Atomic persists and displays the -fast or -ultrafast ID 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’s openai/gpt-6-astra-fast or OpenRouter’s openai/gpt-6-astra-pro remain ordinary catalog IDs with their own rates.
  • Extension hooks: A derived fast variant locks its upstream model ID and tier field (service_tier or speed). 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:
Replace the following:
  • API_KEY: your provider API key.
For full credential precedence (--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.3 and also expose multimodal glm-5.3-flash. Baseten defaults to zai-org/GLM-5.3 and exposes zai-org/GLM-5.3-Fast and zai-org/GLM-5.3-Flash. GLM-5.3 entries support low, high, and max reasoning (not off); use GLM-5.2 when disabled reasoning is required.
  • Qwen Token Plan: Separate Team and Individual providers exist per region, all defaulting to qwen3.8-max. Legacy QWEN_TOKEN_PLAN_API_KEY and QWEN_TOKEN_PLAN_CN_API_KEY still work as fallbacks.
  • Xiaomi MiMo: Reasoning models on xiaomi and xiaomi-token-plan-* support only off and high.
  • Kimi For Coding: Uses OpenAI Chat Completions at https://api.kimi.com/coding/v1 (include /v1 if overriding baseUrl in models.json). Kimi Code models always think, so off isn’t selectable.
Use 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):
Replace the following:
  • ANTHROPIC_API_KEY_VALUE: your Anthropic API key (or an $ENV_VAR reference, as shown for DeepSeek).
  • OPENAI_API_KEY_VALUE: your OpenAI API key.
  • OPENROUTER_API_KEY_VALUE: your OpenRouter API key.
API-key entries can also carry a provider-scoped 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:
Replace the following:
  • API_KEY: your Cloudflare API token.
  • ACCOUNT_ID: your Cloudflare account ID.
  • GATEWAY_ID: your Cloudflare AI Gateway slug.
Key value syntax: Every 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 if ANTHROPIC_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 to nvidia/nemotron-3.5-super-vl-120b-a12b when selected automatically. To launch a session on that model explicitly, run:
Use --list-models or /model to inspect the catalog; a catalog listing doesn’t verify account access or serving availability.

Azure

Use the azure 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:
Replace the following:
  • API_KEY: your Azure OpenAI API key.
  • RESOURCE_NAME: your Azure resource name.
  • GPT4_DEPLOYMENT: your Azure deployment name for gpt-4, if it differs from the model ID.
  • GPT4O_DEPLOYMENT: your Azure deployment name for gpt-4o, if it differs from the model ID.
Root URLs auto-normalize to /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:
Replace the following:
  • 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 (omit AWS_SESSION_TOKEN for permanent keys).
  • BEARER_TOKEN: your Amazon Bedrock bearer token.
Amazon Elastic Container Service (ECS) task roles (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.
To start a session on a Bedrock Claude model, run:
Keep these Bedrock behaviors in mind:
  • 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, and gpt-6-luna as direct openai.* IDs plus global.openai.* and us.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 in models.json so reasoning effort is sent).
  • Bedrock API proxies: Set AWS_ENDPOINT_URL_BEDROCK_RUNTIME=https://bedrock-proxy.example.com/bedrock. If the proxy handles signing, set AWS_BEDROCK_SKIP_AUTH=1. If your proxy doesn’t support HTTP/2, set AWS_BEDROCK_FORCE_HTTP1=1.
  • Bedrock retries: Leaving retry.provider.maxRetries unset keeps the AWS retry count. Bedrock still stops retrying when a rate limit or server error specifies a wait longer than retry.provider.maxRetryDelayMs (60 seconds by default), so chat can use the next eligible fallback. See Retry for settings and examples.

Cloudflare AI Gateway

Save CLOUDFLARE_API_KEY with /login or export it alongside your account ID and gateway slug before launching Atomic:
Replace the following:
  • 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.
Cloudflare AI Gateway routes to Workers AI (/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

Save CLOUDFLARE_API_KEY with /login or export it alongside CLOUDFLARE_ACCOUNT_ID:
Replace the following:
  • API_KEY: your Cloudflare API token.
  • ACCOUNT_ID: your Cloudflare account ID.
Atomic sets 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:
Replace the following:
  • 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.
To configure Gemini Decisions as your decision model:
  1. 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 google or set GEMINI_API_KEY (or GOOGLE_API_KEY) before starting Atomic. Atomic checks the saved google key first, then GEMINI_API_KEY, then GOOGLE_API_KEY. There is no /login google-decisions entry, and the API isn’t available through Vertex AI.
  2. Open /settings → Decision model and choose google-decisions/gemini-decision-1 (applies immediately without /reload), or add the following setting to settings.json and run /reload:
Saving a key alone doesn’t set your decision model. Choose Not set in /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 to structured_output or generateStructuredOutput(). decisionModel is 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—a compactionModel naming 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 images array on the state; states that already define images can’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 401 indicates an invalid key, HTTP 422 a contract error, HTTP 429 or 529 a rate limit or overload). See Structured decision limits.
For all built-in classifiers (including Gemini Decisions, OpenAI Decisions, Cloudflare Clef, OpenRouter, Vercel AI Gateway, and local 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 local llama.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

Run atomic auth check to verify effective credentials in continuous integration (CI), scripts, or before launching a session:
The command reports readiness as follows:
  • Status and exit codes: Prints ready (exit 0), not_ready (exit 1), or invalid (exit 2).
  • JSON output (--json): Returns { status, provider, authType?, reason?, credentials? }. Possible reason values are provider_not_found, credentials_not_configured, credential_expired, credential_not_available, and invalid_state.
  • OAuth refresh versus read-only probe: Checks refresh expired OAuth tokens by default through the locked auth.json path. Pass --no-refresh for a read-only check that never creates, locks, or writes files.
  • Opt-in credential export (--credentials): Readiness output omits secret values by default. Pass --credentials with --provider or an exact --model to emit the resolved credential on stdout (or in JSON credentials); OAuth exports require at least 30 minutes of remaining lifetime when --no-refresh prevents a refresh. Non-ready and invalid statuses write to stderr so stdout stays empty—except exit 9, which reports a partial write to stdout (discard those bytes; exit 8 means nothing was written).
For external tools or proxies that need a raw API key or refreshed OAuth bearer token on stdout, use 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 Request on GitHub Copilot: A business or enterprise personal access token was routed to the individual Copilot host. Export COPILOT_API_TARGET set to your organization’s Copilot host.
  • HTTP 401 or 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 !command in auth.json keeps failing after unlocking your vault: auth.json caches !command results (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 /login prompt, or run atomic auth login <provider> --no-browser from your terminal.
  • Provider still authenticated after /logout: /logout removes only entries in auth.json. Unset the environment variable or remove the models.json apiKey named 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.