---
title: "Google AI Mode (JSON Body)"
method: POST
path: "/v1/web/ai-mode"
tags: ["Google Search"]
---

# Google AI Mode (JSON Body)

`POST /v1/web/ai-mode`

## Request

- Base URL: `https://apidirect.io`
- URL: `https://apidirect.io/v1/web/ai-mode`
- Auth: API key in header `X-API-Key`

Same behaviour as GET /v1/web/ai-mode, with the parameters sent as a JSON body instead of query string parameters. Use POST for long prompts that do not fit comfortably in a URL. If a parameter is sent in both places, a non-empty query string value takes precedence over the body. In the rare case where Google returns no answer, the response is still 200 with an empty reply_parts array. Every field may be sent either in the JSON body or as a query parameter; when both are present the query parameter wins. A request that supplies `prompt` as a query parameter therefore needs no body at all.

**Price:** $0.005 per request. **Free tier:** 50 requests/month.

## Query parameters

- `prompt` string
- `country` string
- `language` string
- `session_token` string

## Request body

- object
  - `prompt` string, required: The AI Mode prompt (max 12000 characters)
  - `country` string: 2-letter ISO 3166-1 alpha-2 country code. A value that is not exactly 2 letters is rejected with 400.
  - `language` string: 2-letter ISO 639-1 language code. A value that is not exactly 2 letters is rejected with 400.
  - `session_token` string: Token from a previous AI Mode response. Pass it to continue the conversation with prior context. Treat as an opaque string.

## Response `200`

Successful response

- GoogleAiModePostResponse: Inferred from a live response. Any field can be null or absent, and new fields may be added at any time.
  - `reply_parts` object[], nullable
    - `type` string, nullable
    - `text` string, nullable
    - `ordered` boolean, nullable
    - `list` object[], nullable
      - `title` string, nullable
      - `text` string, nullable
  - `reference_links` object[], nullable
    - `title` string, nullable
    - `link` string, nullable
    - `snippet` string, nullable
    - `source` string, nullable
    - `favicon` string, nullable
    - `date` string, nullable
  - `session_token` string, nullable

## Other responses

- `400`: Bad request: missing or invalid parameters
- `401`: Unauthorized: invalid or missing API key
- `402`: Free tier used up for this endpoint and no payment method on file (`payment_required`).
- `403`: Account blocked after a failed payment (`account_blocked`).
- `413`: Request body larger than 1 MB (`payload_too_large`).
- `429`: Rate limit exceeded or too many concurrent requests
- `500`: Internal server error
- `502`: Temporary failure retrieving search data. Please retry shortly.
- `503`: Service temporarily unavailable. Please retry shortly.
- `504`: The request timed out

---

[API](https://skmtc.dev/apidirect/apis/api-direct.md) · [All operations](https://skmtc.dev/apidirect/apis/api-direct/llms.txt) · [OpenAPI document](https://skmtc.dev/apidirect/apis/api-direct/revisions/fa8c68d70bd0?raw)
