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

# Configuration

> Environment variables and local profile settings for the DZap AI CLI.

## Required variables

```bash theme={null}
OPENAI_API_KEY=...
```

## Common runtime variables

| Variable                 | Default        | Purpose               |
| ------------------------ | -------------- | --------------------- |
| `PORT`                   | `3001`         | HTTP server port      |
| `DZAP_OPENAI_MODEL`      | `gpt-4o-mini`  | Model override        |
| `DZAP_MODEL_MAX_RETRIES` | `2`            | Model retry count     |
| `DZAP_MODEL_TIMEOUT_MS`  | `4500000`      | Model timeout         |
| `LOG_LEVEL`              | `info`         | Runtime logging level |
| `DB_PATH`                | `schedules.db` | Scheduler SQLite path |

## CLI-specific variables

| Variable                    | Purpose                                   |
| --------------------------- | ----------------------------------------- |
| `DZAP_CLI_DEBUG`            | Toggle debug output defaults              |
| `DZAP_CONFIRM_TRANSACTIONS` | Default transaction confirmation behavior |

## RPC override variables

Resolution order for transaction execution:

1. `DZAP_RPC_URL_<chainId>`
2. `RPC_URL_<chainId>`
3. `DZAP_RPC_URL`
4. built-in public RPC fallback list

## Optional provider keys

| Variable              | Used by                                                                    |
| --------------------- | -------------------------------------------------------------------------- |
| `TAVILY_API_KEY`      | `WebSearchTool` and the `TrendingNewsTool` news fallback                   |
| `CRYPTOPANIC_API_KEY` | `TrendingNewsTool` (primary source; falls back to Tavily when unavailable) |
| `COINSTATS_API_KEY`   | CoinStats wrapper tools                                                    |
| `MORALIS_API_KEY`     | Moralis wrapper tools                                                      |

<Note>
  `TrendingNewsTool` tries CryptoPanic first and automatically falls back to a
  Tavily news search, so `TAVILY_API_KEY` is the practical requirement for news.
</Note>

## MCP HTTP server variables

| Variable                   | Purpose                                                                  |
| -------------------------- | ------------------------------------------------------------------------ |
| `DZAP_MCP_HTTP_ENABLED`    | Enable/disable the `/mcp` HTTP transport (default on)                    |
| `DZAP_MCP_HTTP_TOKEN`      | When set, every `/mcp` request must send `Authorization: Bearer <token>` |
| `DZAP_MCP_ALLOWED_ORIGINS` | Comma-separated `Origin` allowlist for `/mcp`                            |

## Profile file

* macOS/Linux: `~/.dzapai/config.json`
* Windows: `%USERPROFILE%\.dzapai\config.json`

Example:

```json theme={null}
{
  "wallet": "0xYourAddress",
  "chain": "42161",
  "blockchain": "evm",
  "privateKey": "0x..."
}
```

## Scheduler storage

By default, schedules are persisted to `schedules.db` in the runtime working directory.
