ai-cli

Commands

Full reference for all ai-cli commands and flags.

image

Generate images from a prompt.

bash
ai image "a sunset over mountains"
ai image "edit this" < photo.png

Options

-m, --model

string

Model ID. Comma-separated for multi-model.

-o, --output

path

Output file path or directory.

-n, --count

numberdefault: 1

Number of images per model.

-p, --concurrency

numberdefault: 4

Max parallel generations.

--size

WxH

Image size (e.g. 1024x1024). Not supported by Gemini image models — use --aspect-ratio instead.

--aspect-ratio

W:H

Aspect ratio (e.g. 16:9).

--quality

standard | hd

Quality level (OpenAI models only).

--style

vivid | natural

Style (OpenAI models only).

--no-preview

boolean

Disable inline image preview.

-q, --quiet

boolean

Suppress progress output.

--json

boolean

Output metadata as JSON.


video

Generate video from a prompt or image.

bash
ai video "a spinning triangle"
ai image "a dragon" | ai video "animate this"

Options

-m, --model

string

Model ID. Comma-separated for multi-model.

-o, --output

path

Output file path or directory.

-n, --count

numberdefault: 1

Number of videos per model.

-p, --concurrency

numberdefault: 2

Max parallel generations.

--aspect-ratio

W:H

Aspect ratio (e.g. 16:9).

--duration

seconds

Duration in seconds.

--no-preview

boolean

Disable inline video frame preview.

-q, --quiet

boolean

Suppress progress output.

--json

boolean

Output metadata as JSON.


text

Generate text from a prompt.

bash
ai text "explain quantum computing"
ai text "summarize this" < notes.txt

Options

-m, --model

string

Model ID (creator/model). Comma-separated for multi-model.

-o, --output

path

Output file path or directory.

-f, --format

md | txtdefault: md

Output format.

-n, --count

numberdefault: 1

Number of generations per model.

-p, --concurrency

numberdefault: 4

Max parallel generations.

-s, --system

string

System prompt.

--max-tokens

number

Maximum tokens to generate.

-t, --temperature

number

Temperature (0–2).

-q, --quiet

boolean

Suppress progress output.

--json

boolean

Output metadata as JSON.


audio

Generate speech from text or transcribe audio to text.

bash
ai audio speak "Hello from AI Gateway"
ai audio transcribe recording.mp3
cat voice-note.mp3 | ai audio transcribe -o transcript.txt

audio speak

-m, --model

string

Speech model ID. Comma-separated for multi-model.

-o, --output

path

Output file path or directory.

-f, --format

stringdefault: mp3

Audio output format.

--voice

string

Voice to use for speech generation.

--instructions

string

Instructions for speech generation.

--speed

number

Speech speed.

--language

code

Language code, such as en or fr, or auto.

-n, --count

numberdefault: 1

Number of generations per model.

-p, --concurrency

numberdefault: 4

Max parallel generations.

-q, --quiet

boolean

Suppress progress output.

--json

boolean

Output metadata as JSON.

--no-play

boolean

Disable audio playback after generation.

--no-waveform

boolean

Disable accurate terminal waveform preview.

audio speak accepts text from an argument or stdin:

bash
echo "Ship the changelog" | ai audio speak -o changelog.mp3
cat announcement.txt | ai audio speak --format wav -o announcement.wav

audio transcribe

-m, --model

string

Transcription model ID. Comma-separated for multi-model.

-o, --output

path

Output file path or directory.

-f, --format

md | txtdefault: txt

Transcript output format.

-n, --count

numberdefault: 1

Number of transcriptions per model.

-p, --concurrency

numberdefault: 4

Max parallel transcriptions.

-q, --quiet

boolean

Suppress progress output.

--json

boolean

Output metadata as JSON.

audio transcribe accepts a local path, file:// URL, http(s):// URL, or piped audio:

bash
ai audio transcribe meeting.mp3
ai audio transcribe https://example.com/call.wav
cat recording.mp3 | ai audio transcribe

models

List available models from the AI Gateway, or show detailed info for one model.

bash
ai models
ai models --type image
ai models --creator openai --json
ai models claude-opus-4.6
ai models anthropic/claude-opus-4.6 --json

Arguments

[model]

string

Model ID or short name. Shows a detail card with context window, max output, pricing (input, output, cache read/write, web search), release date and per-provider latency, throughput and uptime.

Options

--type

text | image | video | audio | speech | transcription

Filter by modality (list mode only).

--creator

string

Filter by creator (e.g. openai, google) (list mode only).

--json

boolean

Output as JSON with descriptions.

Models are fetched live from the AI Gateway.


Timeouts

Requests that exceed the per-command timeout are aborted automatically:

CommandTimeout
text120 seconds
image300 seconds
video300 seconds
audio speak120 seconds
audio transcribe120 seconds

Image and video generation use a longer timeout because models typically need more processing time.

Exit codes

CodeMeaning
0Success
1All generations failed
2Partial failure (some succeeded, some failed)