credentials
engine credentials: subscriptions and API keys
Manage subscriptions and API keys, one per variable in each scope. Your personal ones are yours alone; workspace ones serve every member, and only owners and admins change them. A task runs on its requester's own, else the workspace's.
credentials list [--server <server>] [--yes] [--json]
list your keys and the workspace keys, by variable
--server <server>act on your Coder server, in the saved workspace--yesconnect to a server used for the first time without asking--jsonJSON output
credentials add [--env <env>] [--value <value>] [--workspace] [--no-check] [--server <server>] [--yes] [--json]
store an API key or subscription for one variable
Store the key of one environment variable, encrypted on the server, as your own or with --workspace for every member. A key saved for that variable in the same scope is replaced. Where the server has subscription sign-in on, CLAUDE_CODE_OAUTH_TOKEN takes your own claude setup-token output.
--env <env>the variable tasks read the key as (reads that variable by default)--value <value>literal values land in shell history and are visible to other processes; use - for stdin or prefer environment variables--workspacea workspace key; owners and admins only--no-checkskip the provider key check--server <server>act on your Coder server, in the saved workspace--yesconnect to a server used for the first time without asking--jsonJSON output
ANTHROPIC_API_KEY=sk-... coder credentials add --env ANTHROPIC_API_KEY # your own Claude key, read from the environment
OPENAI_API_KEY=sk-... coder credentials add --env OPENAI_API_KEY --workspace # a workspace key every member's tasks can use
pbpaste | coder credentials add --env OPENROUTER_API_KEY --value - # a key for custom models, value from stdin
credentials login [engine] [--server <server>] [--yes] [--json]
sign in to a claude or codex subscription on the server
Runs the official claude or codex sign-in on the server's runner, prints the sign-in link or device code, and waits. Claude asks you to paste the code the sign-in page shows. The result replaces your subscription for that engine. Needs CLAUDE_SUBSCRIPTIONS=1 or CODEX_SUBSCRIPTIONS=1 on the server.
<engine>claude or codex--server <server>act on your Coder server, in the saved workspace--yesconnect to a server used for the first time without asking--jsonJSON output
credentials remove <NAME> [--workspace] [--server <server>] [--yes] [--json]
remove the key of one variable
Remove the key of one environment variable.
<NAME>the variable--workspacethe workspace key of that variable--server <server>act on your Coder server, in the saved workspace--yesconnect to a server used for the first time without asking--jsonJSON output