Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
ff4fe56b2This file is pinned to the selected release. Download the original to open it in your design tool.
# API keys are read from the environment only; never commit a real .env
# Copy this file to .env and fill in your keys (.env is gitignored)
#
# copperhead loads .env from the directory you run it in. A variable already set
# in your shell always wins over this file.
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
# Optional: saved-login for the Claude Code provider (--model claude-code).
# Drives Claude Code via the Claude Agent SDK and reuses your saved login, so a
# Claude subscription runs copperhead with NO ANTHROPIC_API_KEY. Mint it with
# `claude setup-token` while logged into Claude Code. The Claude Agent SDK
# (`@anthropic-ai/claude-agent-sdk`) ships as an optional dependency, so a normal
# install includes it. copperhead never reads or logs this credential; the CLI
# owns authentication.
CLAUDE_CODE_OAUTH_TOKEN=
# Optional: default model. Overridden by --model, and it overrides the `model`
# field in .copperhead/config.json.
#
# cursor Cursor Agent CLI, saved login (`agent login`, no API key)
# cursor:<id> the same, on a specific model id
# claude-code Claude Code, saved login (no API key; uses the token above)
# claude-code:<id> the same, on a specific model id
# claude the Anthropic API provider on its default model
# claude-<id> any Anthropic API model id, passed through as-is
# codex local Codex CLI using its saved ChatGPT login (no API key)
# codex:<id> local Codex CLI with an explicit model id
# gpt-5 the OpenAI provider on its default model
# <anything> sent to OpenAI as a model id, e.g. gpt-5-mini
#
# Routing is by prefix, matched top to bottom: "claude-code" is checked before
# the "claude" prefix (Anthropic API, needs ANTHROPIC_API_KEY); "codex" uses the
# local Codex CLI; everything else goes to OpenAI and needs OPENAI_API_KEY. A
# typo like "claud-sonnet-5" routes to OpenAI and fails there.
#
# Left blank, copperhead picks a provider from whichever key is present,
# preferring OPENAI_API_KEY if both are set.
COPPERHEAD_MODEL=
# Optional: path to the authenticated local Codex CLI. The default is `codex`
# on PATH. Only needed for non-standard installations.
COPPERHEAD_CODEX_PATH=
# Optional: path to the Cursor Agent CLI (`agent` / `cursor-agent`). Defaults to
# `agent` on PATH. Only needed for non-standard installations.
COPPERHEAD_CURSOR_PATH=
# --- OpenAI-compatible endpoint -------------------------------
# Point the OpenAI provider at Gemini, Groq, OpenRouter, or a local Ollama.
# Read ONLY by the `compat:<model-id>` model route, so leaving these set never
# redirects a plain `gpt-5` run. Three pieces, always set together: the
# endpoint, the name of the env var holding that endpoint's key, and the key
# itself. A loopback endpoint (Ollama) needs no key of its own - but
# COPPERHEAD_API_KEY_ENV defaults to OPENAI_API_KEY when left unset, and
# whatever that holds (e.g. your OPENAI_API_KEY above) is sent to the endpoint
# regardless. Point COPPERHEAD_API_KEY_ENV at an unset variable name if you
# don't want that.
#
# Gemini:
# COPPERHEAD_BASE_URL=https://generativelanguage.googleapis.com/v1beta/openai/
# COPPERHEAD_API_KEY_ENV=GEMINI_API_KEY
# GEMINI_API_KEY=...
# COPPERHEAD_MODEL=compat:<model-id> (or --model compat:<model-id> per command)
#
# Groq:
# COPPERHEAD_BASE_URL=https://api.groq.com/openai/v1
# COPPERHEAD_API_KEY_ENV=GROQ_API_KEY
# GROQ_API_KEY=...
# COPPERHEAD_MODEL=compat:<model-id> (or --model compat:<model-id> per command)
#
# OpenRouter:
# COPPERHEAD_BASE_URL=https://openrouter.ai/api/v1
# COPPERHEAD_API_KEY_ENV=OPENROUTER_API_KEY
# OPENROUTER_API_KEY=...
# COPPERHEAD_MODEL=compat:<model-id> (or --model compat:<model-id> per command)
#
# Ollama (local, no key):
# COPPERHEAD_BASE_URL=http://localhost:11434/v1
# COPPERHEAD_MODEL=compat:<model-id> (or --model compat:<model-id> per command)
#
# Model ids are whatever the provider calls them - check their model list.
# baseURL must be the OpenAI-compatible base path specifically, not the provider's general API root.
COPPERHEAD_BASE_URL=
COPPERHEAD_API_KEY_ENV=
# A compatible endpoint has no default model (each of the above serves many),
# so COPPERHEAD_MODEL (or --model) must always be set to compat:<model-id> as
# unlike gpt-5/claude, there is no bare "compat" fallback.
# Fill in only the key for the provider you're using, leave the rest blank.
# COPPERHEAD_API_KEY_ENV above must name that same variable, e.g. if you fill
# in GEMINI_API_KEY, set COPPERHEAD_API_KEY_ENV=GEMINI_API_KEY too.
GEMINI_API_KEY=
GROQ_API_KEY=
OPENROUTER_API_KEY=