> ## AI Agent Context
> - Full documentation index: https://aistudio.google.com/llms.txt
> - Gemini Docs MCP server (consistent live info): https://gemini-api-docs-mcp.dev
> - Coding agent skills & setup guide: https://aistudio.google.com/docs/coding-agents.md

# Gemini API CLI

The Gemini API CLI (`gemini-api`) is a stateless, zero-dependency command-line client built for AI agents with shell access, scripts, and CI pipelines. Your coding agent can use it to generate text and media, analyze files, and delegate tasks to [Gemini managed agents](/docs/agents). It works with Antigravity, Claude Code, Cursor, and any standard shell environment.

{% callout type="info" %}
  **Using an AI coding agent?** Install the [`gemini-api-cli`](https://github.com/google-gemini/gemini-skills/tree/main/skills/gemini-api-cli) skill alongside the binary so your agent knows when to call `gemini-api` and how to use its flags, schemas, and output formats:

  ```bash
  npx skills add google-gemini/gemini-skills --skill gemini-api-cli
  ```

{% /callout %}

Every feature runs as a standard shell command on the [Interactions API](/docs/interactions-overview). Run the same commands from an agent subprocess, your terminal, or a CI pipeline:

```bash
# 1. Install on macOS or Linux
curl -fsSL https://raw.githubusercontent.com/google-gemini/gemini-api-cli/main/scripts/install.sh | bash

# 2. Set your API key
export GEMINI_API_KEY="YOUR_API_KEY"

# 3. Generate media, analyze a file, or launch a background managed agent
gemini-api image "Minimalist isometric icon of a cloud database" \
  --output-mime-type image/jpeg \
  --out ./assets/db-icon.jpg
gemini-api analyze -i ./docs/quarterly-report.pdf "Summarize the key findings in three bullets."
gemini-api agent run "Compare WebRTC SFU architectures and cite sources" \
  --agent deep-research-preview-04-2026 \
  --background
```

{% callout type="note" %}
  `gemini-api` is an open-source beta release that evolves alongside the [Interactions API](/docs/interactions-overview). Breaking changes can occur between minor versions. Pin a specific [release version](https://github.com/google-gemini/gemini-api-cli/releases) in automated agent environments and CI pipelines.

{% /callout %}

## Choose the right Gemini tool  {% id="choose-tool" %}

Use `gemini-api` when an agent or script needs to **call** Gemini directly from the shell without adding SDK code to your project. Use the SDKs and [coding agent setup](/docs/coding-agents) when you are **building** Gemini into an application:

| Tool | What it does | When to use it |
| :--- | :--- | :--- |
| **Gemini API CLI** (`gemini-api`) | Calls Gemini models and managed agents from any shell. | Your coding agent, shell script, or CI job needs to generate media, analyze files, or run a background research agent with zero project dependencies. |
| **[Google GenAI SDKs](/docs/libraries)** | Imports Gemini client libraries into Python, TypeScript, JavaScript, Go, Java, or C# code. | You are building Gemini features into your application, backend service, or real-time [Live API](/docs/live-api) session. |
| **[Gemini Docs MCP & skills](/docs/coding-agents)** | Gives coding agents live documentation search and current SDK rules. | Your coding agent is writing application code that imports a Google GenAI SDK. |

{% callout type="note" %}
  `gemini-api` is a stateless API client, not an interactive coding agent like `@google/gemini-cli`. Run `gemini-api` from local coding agents with shell access, terminal scripts, and CI pipelines.

{% /callout %}

## How it works  {% id="how-it-works" %}

Raw REST calls and interactive CLIs often cause issues for coding agents. Base64 media fills the context window, interactive prompts block subprocesses, and stale training data causes hallucinated flags.

Four design choices keep `gemini-api` reliable for agents:

- **Offline schema lookup:** Pass `--usage` to emit the command tree in [KDL](https://kdl.dev) (~49 KB), or `--schema` on commands that accept `--body` to emit the JSON Schema (~92–102 KB for interactions). Redirect those outputs to a file or filter with `jq` instead of dumping them straight into agent context.
- **Files on disk, paths on `stdout`:** Media and transcription commands write files to disk and print only the output path, keeping binary data out of context.
- **Dry runs and structured output:** `--dry-run` validates inputs, redacts credentials, and previews the HTTP request offline without reading the OS keychain. Pass `-o json`, `-o toon`, or `--jq` for machine-readable output (each also emits structured JSON errors on `stderr`). Add `--agent-mode` to default `stdout` to compact TOON, emit structured JSON errors on `stderr`, and suppress interactive forms and color. API request commands never prompt unless you pass `--interactive`. Setup commands (`configure` and `auth login`) open an interactive form on a TTY when called without flags, so pass `--no-interactive` or `--agent-mode` in PTY sessions. Check [exit codes](/docs/cli#exit-codes) to handle failures.
- **Stateless by default:** Commands keep no hidden local state. Chain multi-step work explicitly with `--previous-interaction-id`, an uploaded `files/<id>` URI, or a background interaction ID.

With `-o json`, media commands still write the file to disk and print metadata to `stdout`:

```json
{
  "kind": "image",
  "mime_type": "image/jpeg",
  "path": "/path/to/project/assets/db-icon.jpg",
  "response_id": "v1_...",
  "size_bytes": 2914159,
  "status": "completed"
}
```

## Get started  {% id="get-started" %}

Install the CLI, put `gemini-api` on your `PATH`, set `GEMINI_API_KEY`, and install the `gemini-api-cli` skill for your coding agent.

### 1. Install the binary  {% id="install" %}

{% tabs %}
  {% tab label="macOS and Linux" %}
  ```bash
  curl -fsSL https://raw.githubusercontent.com/google-gemini/gemini-api-cli/main/scripts/install.sh | bash
  ```

  To install a specific release, set `GEMINI_VERSION` to a release tag:

  ```bash
  curl -fsSL https://raw.githubusercontent.com/google-gemini/gemini-api-cli/main/scripts/install.sh | GEMINI_VERSION=<release-tag> bash
  ```

  {% /tab %}

  {% tab label=Windows (PowerShell) %}
  ```powershell
  iwr -useb https://raw.githubusercontent.com/google-gemini/gemini-api-cli/main/scripts/install.ps1 | iex
  ```

  To install a specific release, set `$env:GEMINI_VERSION` to a release tag:

  ```powershell
  $env:GEMINI_VERSION="<release-tag>"; iwr -useb https://raw.githubusercontent.com/google-gemini/gemini-api-cli/main/scripts/install.ps1 | iex
  ```

  {% /tab %}

  {% tab label="Go" %}
  Requires **Go 1.26.10** or later:

  ```bash
  go install github.com/google-gemini/gemini-api-cli/cmd/gemini-api@latest
  ```

  To pin a specific release tag instead of `@latest`, use `@<release-tag>` (for example, `@v0.5.0`).

  {% /tab %}

  {% tab label="Prebuilt binaries" %}
  Download versioned archives for macOS, Linux, and Windows from [GitHub Releases](https://github.com/google-gemini/gemini-api-cli/releases) and place `gemini-api` on your `PATH`. Use prebuilt archives to pin exact versions in Docker images and CI.

  {% /tab %}

{% /tabs %}

### 2. Configure authentication and verify  {% id="authentication" %}

Create an API key in [Google AI Studio](https://aistudio.google.com/apikey) (see [API keys](/docs/api-key)). Set `GEMINI_API_KEY` in your shell and your agent's subprocess environment:

```bash
export GEMINI_API_KEY="YOUR_API_KEY"
```

`gemini-api` reads `GEMINI_API_KEY` (or `GEMINI_ACCESS_TOKEN` for OAuth 2.0) and **does not read `GOOGLE_API_KEY`**. Credentials resolve in priority order: CLI flags (`--api-key` / `--access-token`) > environment variables > OS keychain > `~/.config/gemini-api/config.yaml`. Each request sends one credential, and if both an API key and an access token are set at the same level, the API key takes precedence (pass `--access-token` explicitly on OAuth-only commands such as `files register`).

On a local workstation, run `gemini-api configure` to save your key interactively to your OS keychain (macOS Keychain, Linux Secret Service, or Windows Credential Manager) without pasting plaintext keys into shell history, or pass `--api-key "$GEMINI_API_KEY"` when the variable is already set. Pass `--no-keyring` (or set `GEMINI_NO_KEYRING=true`, using the exact lowercase string `"true"`, not `"1"`) to store credentials in `~/.config/gemini-api/config.yaml` instead:

```bash
# Save to your OS keychain (or run bare gemini-api configure to enter it interactively)
gemini-api configure --api-key "$GEMINI_API_KEY"

# Check the active credential source
gemini-api whoami

# Preview a request offline (does not touch the network, check the key, or read the keychain)
gemini-api generate "Confirm CLI setup in one sentence." --dry-run

# Verify your active credential against the live API
gemini-api models get gemini-4-hydrogen
```

Run `gemini-api auth logout` to clear stored credentials.

{% callout type="warning" %}
  Treat `GEMINI_API_KEY` as a secret. In CI, inject the key from your secret store instead of committing it to a repository or build file.

{% /callout %}

### 3. Install the agent skill  {% id="agent-instructions" %}

Install the [`gemini-api-cli`](https://github.com/google-gemini/gemini-skills/tree/main/skills/gemini-api-cli) skill so your coding agent knows when to reach for `gemini-api`, how to inspect `--usage` and `--schema`, and how to chain file paths and interaction IDs:

```bash
# Install in your current project (add --global to install across all projects)
npx skills add google-gemini/gemini-skills --skill gemini-api-cli
```

In Antigravity, you can also install the [Gemini API plugin](/docs/coding-agents#gemini-api-plugin) (`agy plugin install https://github.com/google-gemini/gemini-skills`), which bundles `gemini-api-cli` with all official Gemini skills and the Docs MCP server.

{% details %}
  {% summary %}
  Manual fallback (`AGENTS.md` / `CLAUDE.md`)

  {% /summary %}

  If your environment doesn't support agent skills, add this snippet to your project's `AGENTS.md`, `CLAUDE.md`, `.cursorrules`, or system prompt:

  ```markdown
  ## Gemini API CLI (`gemini-api`)
  
  You have access to `gemini-api` through the shell. Use it to generate text or media (images, speech, music, video), analyze documents and recordings, or run and manage Gemini managed agents.
  
  1. Run `gemini-api --help` or `gemini-api <command> --help` to choose a command and check flags. Avoid printing `--usage` (~49 KB) or `--schema` (~92-102 KB for interaction commands) directly into context; redirect them to a file (`> schema.json`) or filter with `jq` (for example, `gemini-api generate --schema | jq '."$defs".ModelInteraction.properties | keys'`).
  2. Preview unfamiliar or complex calls offline with `--dry-run -o json` and confirm every nested `--body` field is preserved in the preview.
  3. For a single JSON result or `--jq` filtering on `generate` or `agent run`, pass `--stream=false -o json` (or `--stream=false --jq '<expr>'` so results stay single-object even when `GEMINI_OUTPUT_FORMAT` is set).
  4. To chain multi-step workflows, capture the output paths that media and transcription commands print to stdout (if `-o json` or `--agent-mode` is active, use `--jq '.path'` for `image`/`tts`/`music`/`video`, `--jq '.results[].path'` for `transcribe`, and `--jq '.name'` for `files upload`), and the `id` values returned by `generate` or `agent run`.
  ```

{% /details %}

Then prompt your coding agent as usual:

```none
Build a landing page for our developer tool. Use Gemini to generate a hero
illustration and a 15-second welcome voiceover, and start a background Deep
Research agent to compare competing CLI onboarding flows. Wire the assets and
findings into the page.
```

## Commands  {% id="commands" %}

Run `gemini-api --help` to list all commands, `gemini-api explore` to browse them interactively, `gemini-api version` (or `-v`) to check your installed version, or `gemini-api completion` to generate shell completions (`bash`, `fish`, `powershell`, `zsh`).

| Group | Command | Default model | What it does |
| :--- | :--- | :--- | :--- |
| Create | `generate` | `gemini-4-hydrogen` | Generates text and streams it to `stdout` (`--stream=false` returns one complete result). |
| Create | `image` | `gemini-nano-banana-2.1` | Generates or edits images (`-i`), writes an image file (default format depends on model; pass `--output-mime-type image/jpeg` to force JPEG), and prints its path. |
| Create | `tts` | `gemini-3.8-flash-tts` | Synthesizes 24 kHz mono WAV speech (one or two speakers) with optional `--style` and `--voice-prompt`, and prints the output path. |
| Create | `music` | `lyria-3.5` | Generates music tracks or loops, writes the audio file, and prints its path. |
| Create | `video` | `gemini-omni-1.2-flash` | Generates or edits MP4 clips and waits until done (`--async` returns an ID immediately). |
| Understand | `analyze` | `gemini-4-hydrogen` | Answers questions about PDFs, images, audio, video, CSV and text files, Office documents, or public YouTube URLs. |
| Understand | `transcribe` | `gemini-3.5-transcribe` *(audio)* / `gemini-4-hydrogen` *(video)* | Writes speaker-labeled, timestamped transcripts (`md`, `text`, `json`, or `srt`) and prints the output paths. |
| Manage | `agent` | `gemini-4-hydrogen` *(model runs)* | Runs models or managed agents (`run`, `status`, `cancel`, `delete-interaction`) and manages custom agent definitions (`create`, `list`, `get`, `delete`). |
| Manage | `voices` | — | Designs, replicates, lists, inspects, and deletes custom voices (`create`, `list`, `get`, `delete`). |
| Manage | `files` | — | Manages files in the Files API (`upload`, `list`, `get`, `delete`, `generated-files-list`, and `register` for Cloud Storage files using OAuth 2.0 `--access-token`). |
| Manage | `models` | — | Bare `models` prints the offline curated model catalog; `models list` (with optional `--all`) and `models get <id>` query the live API. |
| Manage | `configure`, `auth`, `whoami` | — | Configures credentials and defaults (`configure`), manages stored credentials (`auth login`, `auth whoami`, `auth logout`), and shows active auth state (`whoami`). |
| Advanced | `environments` | — | Manages hosted and self-hosted sandbox environments (`create`, `list`, `get`, `delete`), workspace files (`files list`, `files upload`, `files download`), and self-hosted runtimes (`connect`, `poll`, `serve`). |
| Advanced | `credentials` | — | Manages stored server-side credentials (`create`, `list`, `get`, `update`, `delete`) for managed agents. |
| Advanced | `webhooks` | — | Manages webhook endpoints and signing secrets (`create`, `list`, `get`, `update`, `ping`, `rotate-signing-secret`, `delete`). |
| Advanced | `triggers` | — | Inspects, runs, updates, and deletes existing cron triggers (`list`, `get`, `update`, `run`, `list-executions`, `delete`). Creating new triggers via the CLI is not yet supported. |

## Workflows  {% id="workflows" %}

Each command defaults to a model suited for its task. Pass `--model` (`-m`) to pick a different model. Run `gemini-api models` for the offline catalog or `gemini-api models list` for live models available to your key.

### Image generation and editing  {% id="image" %}

Agents building web or mobile UIs can generate placeholders, icons, and hero images with [Nano Banana](/docs/image-generation) (default: `gemini-nano-banana-2.1`). Pass `--output-mime-type image/jpeg` when saving to `.jpg`, and pass a generated path back in with `-i` (or pass `--previous-interaction-id`) to edit the image:

```bash
# Generate a 16:9 JPEG image at 2K resolution (512, 1K, 2K, or 4K) and capture its path
HERO_PATH=$(gemini-api image "Friendly robot mascot in a sunlit workshop, space on left for headline" \
  --aspect-ratio 16:9 \
  --image-size 2K \
  --output-mime-type image/jpeg \
  --out ./public/images/hero.jpg)

# Edit the generated image
gemini-api image "Add a winter scarf and soft snowfall outside the window" \
  -i "$HERO_PATH" \
  --output-mime-type image/jpeg \
  --out ./public/images/hero-winter.jpg
```

Pass `-i` multiple times to combine reference images, such as a character and a style guide.

### Speech synthesis and custom voices  {% id="tts" %}

`gemini-api tts` synthesizes 24 kHz mono WAV audio (`gemini-3.8-flash-tts`) for UI cues, accessibility previews, and narrated walkthroughs. The default voice is `Kore`; choose a prebuilt or custom `voice_<id>` voice with `--voice` (`-v`), steer global delivery with `--style`, or design a new custom voice inline with `--voice-prompt`. For two-speaker dialogue, label each turn in the prompt (optionally with an inline `[style]` direction) and map speakers to voices:

```bash
# Single-speaker speech with delivery style
gemini-api tts "Build succeeded. All integration tests passed." \
  --voice Aoede \
  --style "calm and cheerful" \
  --out ./public/audio/build-ok.wav

# Multi-speaker dialogue with per-turn style cues (exactly two speakers)
gemini-api tts "Alice [excited]: Welcome to the release walkthrough! Bob [calm]: Let's look at what shipped today." \
  --multi-speaker "Alice=Kore,Bob=Puck" \
  --out ./public/audio/release-intro.wav

# Design and store a custom voice on the fly, then speak with it
# (stored voice counts toward project quota and expires after 1 year of inactivity)
gemini-api tts "Welcome to the release briefing." \
  --voice-prompt "Warm, upbeat narrator" \
  --out ./public/audio/welcome.wav
```

To create, inspect, list, or delete reusable voices separately, use `gemini-api voices` (see [Voice design](/docs/voice-design), [Voice remixing](/docs/voice-remixing), and [Voice replication](/docs/voice-replication)):

```bash
# Design and persist a reusable voice (returns a voice_<id>)
gemini-api voices create \
  --store=true \
  --voice '{"type":"prompted","prompted":{"input":"Warm, calm narrator with a British accent"}}'

# List available voices filtered by language (filter flags accept JSON arrays)
gemini-api voices list --language-code '["en-US"]'
```

### Music and video  {% id="music-video" %}

Compose original tracks with [Lyria](/docs/music-generation) (default: `lyria-3.5`), and generate MP4 clips with [Gemini Omni](/docs/video) (default: `gemini-omni-1.2-flash`):

```bash
gemini-api music "Warm ambient synth and acoustic guitar background loop, 95 BPM" \
  --out ./public/audio/bg-loop.mp3

gemini-api video "A drone shot of a mountain landscape at sunrise." \
  --aspect-ratio 16:9 \
  --resolution 1080p \
  --out ./public/video/mountain-sunrise.mp4
```

By default, the `video` command waits for generation to finish and writes the MP4 file to disk. Pass `--async` to return an interaction ID immediately, then run `gemini-api video --resume <id> --out <path>` later. Pass `-i` to animate an existing image, or `--previous-interaction-id` to extend or edit a previous clip.

### Text generation  {% id="generate" %}

`gemini-api generate` streams text to `stdout` using `gemini-4-hydrogen` by default:

```bash
gemini-api generate "Write a one-paragraph welcome message for new users of a note-taking app."
```

Add `--stdin` to pipe plain text into the prompt (without `--stdin`, piped stdin is parsed as a JSON `--body`). Pass `-i` to attach files, `--system` for a system instruction, or `--previous-interaction-id` to continue an earlier interaction.

### Document analysis and transcription  {% id="analyze" %}

`analyze` (`gemini-4-hydrogen`) answers questions about PDFs, images, audio, video, CSV and text files, Office and OpenDocument files, and public YouTube URLs. `transcribe` (`gemini-3.5-transcribe` for audio; automatically falls back to `gemini-4-hydrogen` for video) writes a formatted transcript (`md`, `text`, `json`, or `srt`) to disk:

```bash
gemini-api analyze -i ./docs/product-brief.pdf "List the open questions and who owns each one." > open-questions.md

gemini-api transcribe -i ./fixtures/customer-call.mp4 --format srt --out ./fixtures/customer-call.srt
```

`-i` (`--input`) accepts local paths, uploaded `files/<id>` URIs, or public YouTube URLs. Other `https://` URLs are rejected, and `transcribe` accepts local files and `files/<id>` only (not YouTube URLs). Pass `-i` multiple times to `analyze` to compare files, such as before-and-after screenshots. When passing spreadsheets or other Office documents (`.xlsx`, `.xls`, `.ods`, `.docx`, `.pptx`), include `--mime-type` explicitly if your OS lacks a matching MIME type entry.

`gemini-api` sends local files inline up to a **cumulative** ~14 MB of raw binary data per request across all `-i` inputs (20 MB request payload including base64 encoding). For larger files, upload once with `files upload --wait` and reuse the returned `files/<id>` URI:

```bash
# In default pretty mode, stdout prints the bare files/<id> URI.
# If GEMINI_OUTPUT_FORMAT or --agent-mode is set, append --jq '.name'.
FILE_URI=$(gemini-api files upload ./recordings/all-hands.mp4 --wait)

gemini-api analyze -i "$FILE_URI" "List action items with owners and timestamps."
gemini-api transcribe -i "$FILE_URI" --format json --out ./recordings/all-hands.json
```

### Run and manage agents  {% id="managed-agents" %}

Your coding agent can delegate multi-step research or sandboxed tasks to [Gemini managed agents](/docs/agents), such as the [Deep Research agent](/docs/deep-research). On `agent run`, pass `--background` to get an interaction ID immediately instead of holding a stream open:

```bash
# Launch a Deep Research job in the background and capture its interaction ID
RESEARCH_ID=$(gemini-api agent run "Compare open-source vector index benchmarks and cite primary papers." \
  --agent deep-research-preview-04-2026 \
  --background \
  --jq '.id')

# Check status or fetch the finished result while continuing other work
gemini-api agent status "$RESEARCH_ID" -o json
```

Run `gemini-api agent cancel <id>` to stop a running job. You can also launch the [Antigravity agent](/docs/antigravity-agent) in a remote sandbox with `agent run` (passing `--body '{"environment":"remote"}'`), inspect or transfer sandbox workspace files with `gemini-api environments files` (`list`, `upload`, `download`), or manage [custom agents](/docs/custom-agents) with `agent create`, `list`, `get`, and `delete`. To connect your own sandbox runtime, create an environment with `gemini-api environments create --mode self_hosted` and run `gemini-api environments connect` (see [Self-hosted environments](/docs/agent-environment#self-hosted-environments)).

## Custom request bodies  {% id="custom-bodies" %}

For options without dedicated flags on `generate`, `image`, `music`, `video`, `agent run`, and resource create or update commands, pass a raw [Interactions API](/docs/interactions-overview) JSON payload with `--body` (inline, as `@file.json`, or `@-` from stdin). Use `--body` to set `response_format` schemas, function-calling tools, `generation_config`, or `"store": false`. Task commands (`tts`, `analyze`, `transcribe`) do not accept `--body` or `--schema`, so use `gemini-api generate` or `gemini-api agent run` when you need full request control (file upload commands `files upload` and `environments files upload` also use dedicated flags instead of `--body`). Run `gemini-api <command> --schema` and redirect to a file or pipe to `jq` to inspect valid fields:

```bash
# Inspect the JSON Schema for the request body
gemini-api generate --schema > generate-schema.json

# Return schema-constrained JSON and skip storing the interaction
cat logs.txt | gemini-api generate "Extract every error message from these logs." \
  --stdin \
  --body '{
    "response_format": {
      "type": "text",
      "mime_type": "application/json",
      "schema": {
        "type": "object",
        "properties": {"errors": {"type": "array", "items": {"type": "string"}}},
        "required": ["errors"]
      }
    },
    "store": false
  }'
```

`--body` merges with command flags. If both set the same key, the command fails with exit code `2` so conflicting inputs fail fast.

{% callout type="warning" %}
  `--body` validates duplicate and unknown **top-level** keys, but it silently drops unknown **nested** keys (for example, a misspelled field inside `generation_config`) without returning an error. Always verify custom payloads with `--dry-run -o json` and confirm every nested field appears in the request preview.

{% /callout %}

## Exit codes  {% id="exit-codes" %}

Every command returns a typed exit code so scripts and agents can handle failures without parsing error text. For example, `3` signals an authentication problem and `2` signals invalid command syntax:

| Code | Meaning |
| :--- | :--- |
| `0` | The command succeeded. |
| `1` | Runtime or API error, such as a network failure, rate limit (`429`), not found (`404`), server error (`5xx`), disabled service or billing, or an interaction ending in `failed` or `cancelled`. |
| `2` | Usage or validation error, such as an unknown flag, missing input, duplicate `--body` key, or request validation failure (typically HTTP `400` or `422`). |
| `3` | Authentication or authorization failure, such as a missing or invalid API key or token (typically HTTP `401` or `403`, or `400` on a rejected API key). |

Run `gemini-api --help-global` to list global flags shared by every command (authentication, output, network, and diagnostics).

## Limitations  {% id="limitations" %}

- **API version default:** Unlike the latest Google GenAI SDKs (which default to `v1`), `gemini-api` defaults to **`v1beta`** so preview endpoints (such as TTS, transcription, webhooks, and managed agents) work out of the box. Override it with `--api-version` or `GEMINI_API_VERSION` (see [API versions](/api-reference/api-versions)).
- **Streaming and `--jq`:** Pass `--stream=false` with `-o json` on `generate` and `agent run` to return a single JSON response object instead of NDJSON SSE events. When combining `--jq` with `-o` or `GEMINI_OUTPUT_FORMAT`, include `--stream=false` as well so the filter runs against the complete response.
- **Inline file size and URL inputs:** Inline `-i` inputs share a **cumulative** cap of ~14 MB raw binary data per request (20 MB payload including base64 encoding). `-i` accepts local paths, `files/<id>`, and public YouTube URLs (not arbitrary `https://` URLs; `transcribe` does not accept YouTube URLs). Upload larger files with `gemini-api files upload` (up to 2 GB per file, 50 MB for PDFs; deleted after 48 hours).
- **Flag syntax notes:** `-o` is always `--output-format` (`--out` has no short flag). Array-typed flags (such as `files register --uris`, `webhooks create --subscribed-events`, and `voices list` filters) take a single JSON array string (`'["a","b"]'`), not repeated flags.
- **No bidirectional streaming:** `gemini-api` supports standard HTTP requests, SSE streaming, and async polling, not bidirectional WebSockets or WebRTC. For real-time voice, video, or interactive worlds, use the [Live API](/docs/live-api) or [Genie 4](/docs/genie) with the [Google GenAI SDKs](/docs/libraries).

## What's next  {% id="whats-next" %}

- [Coding agent setup](/docs/coding-agents)
- [Interactions API](/docs/interactions-overview)
- [Gemini managed agents](/docs/agents)
- [gemini-api-cli skill on GitHub](https://github.com/google-gemini/gemini-skills/tree/main/skills/gemini-api-cli)
- [gemini-api-cli on GitHub](https://github.com/google-gemini/gemini-api-cli)

