---
title: "Configuration"
description: "Environment variables and defaults."
canonical_url: "https://ai-cli.dev/docs/configuration"
---
# Configuration

ai-cli is configured entirely through environment variables. There is no config file.

## Environment variables

#### `AI_GATEWAY_API_KEY`

Type: `string`

Vercel AI Gateway API key. Provides access to all supported models.

#### `OPENAI_API_KEY`

Type: `string`

Provider-specific key (or other provider keys like `ANTHROPIC_API_KEY`).

#### `AI_CLI_TEXT_MODEL`

Type: `string`

Default text model. Overrides `openai/gpt-5.5`.

#### `AI_CLI_IMAGE_MODEL`

Type: `string`

Default image model. Overrides `openai/gpt-image-2`.

#### `AI_CLI_VIDEO_MODEL`

Type: `string`

Default video model. Overrides `bytedance/seedance-2.0`.

#### `AI_CLI_SPEECH_MODEL`

Type: `string`

Default speech model. Overrides `openai/tts-1`.

#### `AI_CLI_TRANSCRIPTION_MODEL`

Type: `string`

Default transcription model. Overrides `openai/whisper-1`.

#### `AI_CLI_OUTPUT_DIR`

Type: `path`

Default output directory for generated files.

#### `AI_CLI_PREVIEW`

Type: `0 | 1`

`1` forces inline preview on, `0` disables it.

#### `NO_COLOR`

Type: `any`

Disable ANSI color output.

#### `FORCE_COLOR`

Type: `any`

Force color output even when not a TTY.

## Precedence

- `-m` flag always takes priority over `AI_CLI_*_MODEL` env vars.
- `-o` flag always takes priority over `AI_CLI_OUTPUT_DIR`.
- `--no-preview` takes priority over `AI_CLI_PREVIEW`.

## Example shell profile

```bash
export AI_GATEWAY_API_KEY="gw_..."
export AI_CLI_TEXT_MODEL="anthropic/claude-sonnet-4"
export AI_CLI_IMAGE_MODEL="bfl/flux-2-pro"
export AI_CLI_SPEECH_MODEL="openai/tts-1"
export AI_CLI_OUTPUT_DIR="$HOME/ai-output"
```
