Credentials
How Stella stores and resolves API keys — the credential chain and the credentials.toml file.
Stella resolves an API key for the selected provider through a well-defined chain, and can persist keys in a permission-restricted file so you're only prompted once.
The credential chain
For the selected provider, the key is resolved in this order — first hit wins:
--api-keyflag — highest precedence. Requires an explicit--model provider/...(a bare key is ambiguous about which provider it belongs to).- Provider env var — e.g.
ANTHROPIC_API_KEY, plus aliases likeGOOGLE_API_KEYfor Gemini. Aproviders.<id>.api_key_envin settings.json renames the primary variable: the named variable becomes the one checked first and the provider's original env var demotes to an alias — handy for team key rotation (MY_TEAM_ZAI_KEY) without touching anyone's shell profile. settings.json—providers.<id>.api_key(an empty string is treated as unset; see settings.json).~/.config/stella/credentials.toml— the stored-keys file below.- Interactive prompt — on a TTY, when you've named a provider with
--model provider/model_id(e.g.--model anthropic/claude-fable-5), Stella prompts for the key and saves it tocredentials.toml, so you are only asked once. A bare invocation with no--modeluses auto-detection, which does not prompt — it errors with guidance to name a provider instead.
Prefer an env var, settings.json, or credentials.toml over --api-key for anything
long-lived — a flag value is visible in shell history and in ps output.
credentials.toml
Keys can be stored in ~/.config/stella/credentials.toml. It is a flat table keyed by
provider id:
[credentials]
zai = "sk-..."
anthropic = "sk-ant-..."
openai = "sk-..."
# config-defined provider ids work too — key matches your settings.json entry
together = "..."- The file is written with owner-only (
0600) permissions — it holds secrets in plaintext, the same threat model as~/.ssh/config. - Writes are atomic (a temp file is renamed into place), so a reader never sees a half-written file.
- When you enter a key at the interactive prompt, Stella writes it here automatically.
Which key is active?
stella configThis prints the provider, model, and a redacted preview of the active key (a few leading and trailing characters, middle elided) so you can confirm which key is in use without printing the secret.
Cloud provider credentials
Some providers need more than a single key:
- Vertex AI —
VERTEX_ACCESS_TOKENplusVERTEX_PROJECT_ID(orGOOGLE_CLOUD_PROJECT), and optionallyVERTEX_LOCATION. - Amazon Bedrock —
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY, plus optionalAWS_SESSION_TOKENandAWS_REGION.
These are read from the environment. See Providers & models for the full matrix.
Agent engine config
Configure each engine agent — default, worker, judge, triage — with its own model, gateway, prompt, reasoning effort, and sampling parameters via agent_engine_config in settings.json, or interactively in the AGENT ENGINE tab's engine panel.
Examples & recipes
Ready-to-paste configuration files organized by use case — cost-tier pipeline profiles, provider setups from coding-plan subscriptions to air-gapped local servers, and team-shared config.