Skip to main content

Documentation Index

Fetch the complete documentation index at: https://kode-f177b001.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Kode reads a set of environment variables at startup to configure its LLM backend, resolve file paths, and control interactive behavior. You can set these in your shell profile, a .env file at your project root, or in your CI/CD pipeline. Where a variable overlaps with a field in .kode/kode.json, the environment variable takes precedence for API keys and endpoint overrides.

LLM & API keys

KODE_LLM_API_KEY
string
The primary API key for the configured LLM provider. This takes precedence over all other key variables (OPENAI_API_KEY, KODE_PRO_API_KEY). Set this when using the Kode Gateway or any provider that accepts a Bearer token via a single key.
export KODE_LLM_API_KEY=sk-...
OPENAI_API_KEY
string
Standard OpenAI API key. Kode uses this as a fallback when KODE_LLM_API_KEY is not set and no other key is provided. If you are already exporting this variable for other tools, Kode picks it up automatically.
export OPENAI_API_KEY=sk-...
KODE_PRO_API_KEY
string
Kode Pro API key. When this is set and no other key or endpoint overrides are present, Kode bypasses the public gateway and routes directly to api.deepseek.com using the deepseek-v4-flash model. This is the fastest zero-config path for Pro subscribers.
export KODE_PRO_API_KEY=kp-...
KODE_LLM_ENDPOINT
string
default:"https://api.openai.com/v1"
The LLM API endpoint Kode sends chat completion requests to. Override this to point at a local model server, a corporate proxy, or a self-hosted inference endpoint. The value must be a base URL; Kode appends /chat/completions automatically.
# Ollama running locally
export KODE_LLM_ENDPOINT=http://localhost:11434/v1
KODE_LLM_MODEL
string
default:"gpt-4o"
Override the model Kode uses, bypassing the model field in kode.json. Use the same provider/model format as the config file, or a bare model name when pointing at a local endpoint.
export KODE_LLM_MODEL=anthropic/claude-sonnet-4-6

TUI & paths

KODE_TUI_DIR
string
default:"~/.kode/tui"
Custom path for the TUI bundle directory. On first run, Kode downloads the TUI bundle (~52 MB) from GitHub Releases and extracts it to ~/.kode/tui. Set this variable to use a different location — useful when ~ is on a slow filesystem or when you want to share a pre-extracted bundle across users.
export KODE_TUI_DIR=/opt/kode/tui
KODE_TUI_BUNDLE_URL
string
Custom URL to download the TUI bundle archive from. When set, Kode fetches the tui-bundle.tar.gz from this URL instead of GitHub Releases. Use this to point at an internal mirror or a pinned artifact in air-gapped environments.
export KODE_TUI_BUNDLE_URL=https://artifacts.internal/kode/tui-bundle.tar.gz
KODE_DIR
string
default:".kode"
Override the path Kode uses for the .kode config directory. By default Kode looks for .kode/kode.json in the current working directory. Set KODE_DIR to use a directory at a different absolute path — for example, a shared config location on a build server.
export KODE_DIR=/etc/kode
KODE_NO_INSTALL
string
Set to 1 to disable all automatic install prompts. When Kode detects that a dependency (Bun, the TUI bundle, or Sicario) is missing and this variable is set, it fails immediately instead of asking to install. Always set this in CI to prevent pipelines from hanging on interactive prompts.
export KODE_NO_INSTALL=1
SICARIO_PATH
string
Override the path to the Sicario SAST binary. Kode normally installs Sicario into your .kode/ directory via kode init or kode install sicario. Set SICARIO_PATH to point at a pre-installed binary — useful when distributing a company-wide Sicario installation or when the binary lives outside the project tree.
export SICARIO_PATH=/usr/local/bin/sicario

Server authentication

KODE_SERVER_PASSWORD
string
Password for the Kode server. Required when running kode serve to protect the HTTP API from unauthorized access. Clients must supply this password as a credential when connecting.
export KODE_SERVER_PASSWORD=my-secure-password
KODE_SERVER_USERNAME
string
default:"kode"
Username for the Kode server. Paired with KODE_SERVER_PASSWORD to form the basic authentication credential for the server. Defaults to kode if not set.
export KODE_SERVER_USERNAME=kode

Usage notes

For CI/CD pipelines, always set KODE_NO_INSTALL=1 alongside your KODE_LLM_API_KEY. This ensures Kode never pauses on an interactive install prompt and fails fast if any dependency is missing from the runner image.
export KODE_NO_INSTALL=1
export KODE_LLM_API_KEY=<your-api-key>
Environment variables take precedence over .kode/kode.json settings for API keys and endpoints. If both KODE_LLM_ENDPOINT and providers.gateway_url are set, the environment variable wins. This lets you override per-project config at the shell level without editing committed files.

Zero-config mode

If none of KODE_LLM_API_KEY, KODE_LLM_ENDPOINT, OPENAI_API_KEY, or KODE_LLM_MODEL are set, Kode enters zero-config mode and routes to the public Kode Gateway at https://api.trykode.xyz/v1 using deepseek-v4-flash. The public gateway is rate-limited to 20 requests per day per IP on the free (Lite) tier.

kode.json reference

Full reference for all fields in the project config file.

Providers

Configure AI providers, API keys, and model strings.