Environment Variables
Clanker reads the following environment variables. When both a config file value and an environment variable are set, the resolution order depends on the specific variable (see notes below).
AI Provider Keys
These variables provide API keys for the supported AI providers. Each can also be set in the config file under ai.providers.<name>.api_key or ai.providers.<name>.api_key_env.
| Name | Description | Required | Example |
|---|---|---|---|
OPENAI_API_KEY | OpenAI API key | Required if using the openai provider | sk-proj-abc123... |
ANTHROPIC_API_KEY | Anthropic API key | Required if using the anthropic provider | sk-ant-api03-abc123... |
GEMINI_API_KEY | Google AI Studio (Gemini) API key | Required if using the gemini-api provider | AIzaSy... |
DEEPSEEK_API_KEY | DeepSeek API key | Required if using the deepseek provider | sk-abc123... |
COHERE_API_KEY | Cohere API key | Required if using the cohere provider | abc123... |
MINIMAX_API_KEY | MiniMax API key | Required if using the minimax provider | eyJ... |
AWS Variables
| Name | Description | Required | Example |
|---|---|---|---|
AWS_PROFILE | AWS CLI profile to use for infrastructure queries | No (can be set in config or via --profile) | my-dev-profile |
AWS_REGION | AWS region override | No (falls back to profile config, then us-east-1) | us-west-2 |
AWS_DEFAULT_REGION | Fallback AWS region if AWS_REGION is not set | No | us-east-1 |
AWS authentication is handled through local CLI profiles (aws configure --profile <name>), not through raw access key environment variables in Clanker's own configuration. However, standard AWS SDK environment variables like AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are respected by the underlying AWS CLI.
Clanker Backend Variables
These variables configure integration with the Clanker backend service for credential storage and retrieval.
| Name | Description | Required | Example |
|---|---|---|---|
CLANKER_BACKEND_API_KEY | API key for authenticating with the Clanker backend | No (or set via --api-key flag) | ck_live_abc123... |
CLANKER_BACKEND_ENV | Backend environment: testing, staging, or production | No (default: testing) | production |
CLANKER_BACKEND_URL | Custom backend URL; overrides the CLANKER_BACKEND_ENV selection | No | https://api.clanker.example.com |
DigitalOcean Variables
| Name | Description | Required | Example |
|---|---|---|---|
DO_API_TOKEN | DigitalOcean API token | Required if using DigitalOcean and not set in config | dop_v1_abc123... |
DIGITALOCEAN_ACCESS_TOKEN | Alternative DigitalOcean API token variable | No (fallback if DO_API_TOKEN is not set) | dop_v1_abc123... |
Hetzner Variables
| Name | Description | Required | Example |
|---|---|---|---|
HCLOUD_TOKEN | Hetzner Cloud API token | Required if using Hetzner and not set in config | abc123... |
GitHub Variables
| Name | Description | Required | Example |
|---|---|---|---|
GITHUB_TOKEN | GitHub personal access token | No (can be set in config under github.token) | ghp_abc123... |
For the github-models AI provider, Clanker uses the token from gh auth token (the GitHub CLI) rather than this environment variable.
Cloudflare Variables
| Name | Description | Required | Example |
|---|---|---|---|
CLOUDFLARE_API_TOKEN | Cloudflare API token | Required if using Cloudflare and not set in config | abc123... |
CF_API_TOKEN | Alternative Cloudflare API token variable | No (fallback) | abc123... |
CLOUDFLARE_ACCOUNT_ID | Cloudflare account ID | No (some operations work without it) | abc123def456... |
CF_ACCOUNT_ID | Alternative Cloudflare account ID variable | No (fallback) | abc123def456... |
GCP Variables
| Name | Description | Required | Example |
|---|---|---|---|
GCP_PROJECT | GCP project ID | No (can be set in config under infra.gcp.project_id) | my-project-123 |
GOOGLE_CLOUD_PROJECT | Alternative GCP project ID variable | No (fallback) | my-project-123 |
GCLOUD_PROJECT | Alternative GCP project ID variable | No (fallback) | my-project-123 |
For the gemini provider (Vertex AI), GCP Application Default Credentials are used. Run gcloud auth application-default login to configure them.
Azure Variables
| Name | Description | Required | Example |
|---|---|---|---|
AZURE_SUBSCRIPTION_ID | Azure subscription ID | No (can be set in config or via --azure-subscription) | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
AZ_SUBSCRIPTION_ID | Alternative Azure subscription ID variable | No (fallback) | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
OpenRouter Variables
| Name | Description | Required | Example |
|---|---|---|---|
OPENROUTER_API_KEY | OpenRouter API key for Hermes Agent | No (only needed for clanker talk / Hermes) | sk-or-v1-abc123... |
Resolution Priority
For most settings, the resolution order from highest to lowest priority is:
- CLI flag (e.g.,
--openai-key,--profile) - Config file value (e.g.,
ai.providers.openai.api_key) - Environment variable named in the config (e.g., the value of
api_key_env) - Well-known environment variable (e.g.,
OPENAI_API_KEY) - Built-in default