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
| Where | What it holds |
|---|---|
~/.openprogram/auth/<provider>/credentials.json | The provider's ordered list: its sign-ins and its own keys, and a row without a secret for each company key and environment key |
~/.openprogram/auth/_keys/<company>.json | API keys, stored once for the company that issued them |
| Environment variable | A read-only row while it is set, such as OPENAI_API_KEY; read on every use, never copied |
| Amazon Bedrock, Google Vertex | The cloud SDK's own chain, detected at runtime: AWS_PROFILE, access keys, bearer token and so on; ADC |
Files are mode 0600. With --profile <name> the root is ~/.openprogram-<name>/.
Sources
| Source | How |
|---|---|
| API key | openprogram providers login deepseek, or printf %s "$KEY" | openprogram providers login deepseek --api-key-stdin. --api-key also works but lands in shell history. |
| Anthropic | openprogram providers login anthropic, then your Anthropic API key |
login picks the method; --method forces one.
Subscriptions
A ChatGPT or Claude plan is used by running the vendor's own program as an outside agent: Third-Party Harnesses. OpenProgram never signs in to a plan itself (why).
Import from this machine
openprogram providers discover # lists only, writes nothing
openprogram providers adopt qwen_cli # one entry; --all imports everything
| Source | Location | Imported into |
|---|---|---|
| Qwen CLI | ~/.qwen/oauth_creds.json | qwen |
| gh CLI | ~/.config/gh/hosts.yml | github |
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.
| Field | Meaning | Default |
|---|---|---|
command | Argv list, run without a shell | required |
parses | json, or text for stripped stdout | json |
json_key_path | Keys to walk, such as ["creds", "token"]. Empty: the document must be a string | [] |
cache_seconds | Token reuse. 0 runs on every call | 300 |
timeout_seconds | Limit per run | 60 |
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.
| Rule | Behaviour |
|---|---|
| One list | A provider's keys and sign-ins, in order |
| Failover | 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 |
| Strategy | in-order (default, the first usable one), evenly, least-used |
| Pin | A conversation can keep 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