OpenProgram Docs

Authentication

OpenProgram requires safe, lawful and compliant use of Anthropic services: the official API, legitimately obtained API keys, API-account billing, and calls that comply with Anthropic's terms of service and usage policy.

Storage

~/.openprogram/auth/<provider>/<account>.json, mode 0600. With --profile <name> the root is ~/.openprogram-<name>/.

Runtime reads the store only. A key in an environment variable must be imported first, and later changes to the variable do not affect it. Exceptions, detected at runtime: Amazon Bedrock (AWS_PROFILE, access keys, bearer token and so on) and Google Vertex (ADC).

Sources

SourceHow
API keyopenprogram providers login deepseek, or printf %s "$KEY" | openprogram providers login deepseek --api-key-stdin. --api-key also works but lands in shell history.
Anthropicopenprogram providers login anthropic, then your Anthropic API key
openai-codexChatGPT subscription, browser PKCE; or import an existing codex login
gemini-subscriptionImports ~/.gemini/oauth_creds.json; log in with the Gemini CLI first
google-gemini-cliReads ~/.gemini/oauth_creds.json directly, without discover
github-copilotGitHub device code in the browser, or import COPILOT_GITHUB_TOKEN, GH_TOKEN or GITHUB_TOKEN. The short-lived Copilot token is exchanged on demand and never written to disk.

login picks the method; --method forces one.

Import from this machine

openprogram providers discover        # lists only, writes nothing
openprogram providers adopt codex_cli # one entry; --all imports everything
SourceLocationImported into
Codex CLI~/.codex/auth.jsonopenai-codex
Qwen CLI~/.qwen/oauth_creds.jsonqwen
gh CLI~/.config/gh/hosts.ymlgithub
EnvironmentOPENAI_API_KEY, ANTHROPIC_API_KEY and othersThe matching provider

While the external CLI is present a pointer is stored and its file re-read on every call. Otherwise the token is copied and OpenProgram refreshes it.

Helper command

For tokens issued by a CLI such as aws, sso-helper or token-fetcher: in Settings → Model services add type credential_process.

FieldMeaningDefault
commandArgv list, run without a shellrequired
parsesjson, or text for stripped stdoutjson
json_key_pathKeys to walk, such as ["creds", "token"]. Empty: the document must be a string[]
cache_secondsToken reuse. 0 runs on every call300
timeout_secondsLimit per run60

The login smoke test runs it once. A failure (non-zero exit, timeout, bad output, missing key path) fails the request with the command and its stderr, and never falls back to another credential. Fix the helper, or remove it to use another source.

Enterprise SSO (sso) is not implemented; the API and resolver reject it.

Manage

Commands: Configure models.

A provider's keys and sign-ins form one ordered list. A conversation keeps the key it started on; one that is rate limited, out of quota or refused gives way to the next usable one, and the reply shows a one-line notice.

Strategies: in-order (default, the first usable one), evenly, least-used. A conversation can be pinned to one key: Use several keys.

openprogram providers keys openai list
openprogram providers keys openai add --name work
openprogram providers keys openai move work --to 1
openprogram providers keys openai strategy evenly
Codex sign-in
  • Program calls use the provider's list like a conversation does: the first usable sign-in, in the order openprogram providers keys openai-codex list shows. Signing in again with the same ChatGPT account renews its row.
  • Terminal authentication failures and errors marked non-retryable stop after one request, keeping their category through the Program runtime. Other callback failures keep the Program's bounded recovery.
  • The callback listener starts before the authorization page. Keep the provider panel open until it reports success.
ProblemDo
Page does not openOpen sign-in page
Callback cannot reach the appPaste the callback URL into the login panel; it must belong to the current attempt
Code expired or already usedStart a fresh sign-in
Token exchange returns HTTP 403OpenAI refused; account access or the network may be the cause. The panel names recognized authorization errors and shows connection retries.

Cancelling or leaving the panel ends the attempt.

Last updated · 2026-11-25