Skip to content

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.

NameDescriptionRequiredExample
OPENAI_API_KEYOpenAI API keyRequired if using the openai providersk-proj-abc123...
ANTHROPIC_API_KEYAnthropic API keyRequired if using the anthropic providersk-ant-api03-abc123...
GEMINI_API_KEYGoogle AI Studio (Gemini) API keyRequired if using the gemini-api providerAIzaSy...
DEEPSEEK_API_KEYDeepSeek API keyRequired if using the deepseek providersk-abc123...
COHERE_API_KEYCohere API keyRequired if using the cohere providerabc123...
MINIMAX_API_KEYMiniMax API keyRequired if using the minimax providereyJ...

AWS Variables

NameDescriptionRequiredExample
AWS_PROFILEAWS CLI profile to use for infrastructure queriesNo (can be set in config or via --profile)my-dev-profile
AWS_REGIONAWS region overrideNo (falls back to profile config, then us-east-1)us-west-2
AWS_DEFAULT_REGIONFallback AWS region if AWS_REGION is not setNous-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.

NameDescriptionRequiredExample
CLANKER_BACKEND_API_KEYAPI key for authenticating with the Clanker backendNo (or set via --api-key flag)ck_live_abc123...
CLANKER_BACKEND_ENVBackend environment: testing, staging, or productionNo (default: testing)production
CLANKER_BACKEND_URLCustom backend URL; overrides the CLANKER_BACKEND_ENV selectionNohttps://api.clanker.example.com

DigitalOcean Variables

NameDescriptionRequiredExample
DO_API_TOKENDigitalOcean API tokenRequired if using DigitalOcean and not set in configdop_v1_abc123...
DIGITALOCEAN_ACCESS_TOKENAlternative DigitalOcean API token variableNo (fallback if DO_API_TOKEN is not set)dop_v1_abc123...

Hetzner Variables

NameDescriptionRequiredExample
HCLOUD_TOKENHetzner Cloud API tokenRequired if using Hetzner and not set in configabc123...

GitHub Variables

NameDescriptionRequiredExample
GITHUB_TOKENGitHub personal access tokenNo (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

NameDescriptionRequiredExample
CLOUDFLARE_API_TOKENCloudflare API tokenRequired if using Cloudflare and not set in configabc123...
CF_API_TOKENAlternative Cloudflare API token variableNo (fallback)abc123...
CLOUDFLARE_ACCOUNT_IDCloudflare account IDNo (some operations work without it)abc123def456...
CF_ACCOUNT_IDAlternative Cloudflare account ID variableNo (fallback)abc123def456...

GCP Variables

NameDescriptionRequiredExample
GCP_PROJECTGCP project IDNo (can be set in config under infra.gcp.project_id)my-project-123
GOOGLE_CLOUD_PROJECTAlternative GCP project ID variableNo (fallback)my-project-123
GCLOUD_PROJECTAlternative GCP project ID variableNo (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

NameDescriptionRequiredExample
AZURE_SUBSCRIPTION_IDAzure subscription IDNo (can be set in config or via --azure-subscription)xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
AZ_SUBSCRIPTION_IDAlternative Azure subscription ID variableNo (fallback)xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

OpenRouter Variables

NameDescriptionRequiredExample
OPENROUTER_API_KEYOpenRouter API key for Hermes AgentNo (only needed for clanker talk / Hermes)sk-or-v1-abc123...

Resolution Priority

For most settings, the resolution order from highest to lowest priority is:

  1. CLI flag (e.g., --openai-key, --profile)
  2. Config file value (e.g., ai.providers.openai.api_key)
  3. Environment variable named in the config (e.g., the value of api_key_env)
  4. Well-known environment variable (e.g., OPENAI_API_KEY)
  5. Built-in default