> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kong.fyi/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment Variables

> All environment variables recognized by Kong

## Reference

| Variable             | Required             | Default          | Description                                                                                                             |
| -------------------- | -------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `ANTHROPIC_API_KEY`  | At least one API key | —                | API key for Anthropic (Claude) models. Get one at [console.anthropic.com](https://console.anthropic.com/settings/keys). |
| `OPENAI_API_KEY`     | At least one API key | —                | API key for OpenAI (GPT-4o) models. Get one at [platform.openai.com](https://platform.openai.com/api-keys).             |
| `GHIDRA_INSTALL_DIR` | No                   | Auto-detected    | Path to your Ghidra installation directory. Only needed if auto-detection fails.                                        |
| `JAVA_HOME`          | No                   | Auto-detected    | Path to your JDK installation. Only needed if auto-detection fails.                                                     |
| `KONG_CONFIG_DIR`    | No                   | `~/.config/kong` | Override the directory where Kong stores its configuration database.                                                    |

## API keys

You need **at least one** API key — either Anthropic or OpenAI. If you're using a [custom endpoint](/configuration/custom-endpoints), no API key is required (or you can set one during `kong setup` if your endpoint requires authentication).

```bash theme={null}
# Set your API key(s)
export ANTHROPIC_API_KEY="sk-ant-api03-..."
export OPENAI_API_KEY="sk-..."
```

<Tip>
  Add these to your shell profile (`~/.zshrc`, `~/.bashrc`) so they persist across sessions.
</Tip>

## Ghidra and JDK auto-detection

Kong searches common installation paths for Ghidra and JDK. You only need to set `GHIDRA_INSTALL_DIR` and `JAVA_HOME` if:

* You installed Ghidra in a non-standard location
* Auto-detection picks the wrong version
* You're running in a container or CI environment

```bash theme={null}
export GHIDRA_INSTALL_DIR="/opt/ghidra_11.3"
export JAVA_HOME="/usr/lib/jvm/java-21-openjdk"
```

## Config directory

Kong stores its configuration (enabled providers, default provider, custom endpoint settings) in an SQLite database at `~/.config/kong/config.db`. Override the location:

```bash theme={null}
export KONG_CONFIG_DIR="/path/to/custom/config"
```

## Further reading

* [Installation](/getting-started/installation) — full setup guide
* [LLM Providers](/configuration/llm-providers) — provider configuration
