---
title: "Google AI Mode API: Answers and Follow-ups as JSON"
description: "Google has no AI Mode API. GET /v1/google-search/google-ai-mode-search takes q, hl, gl and a follow_up_token; a three-turn conversation costs 3 credits."
url: https://perceptlayer.com/blog/google-ai-mode-api
---

[Blog](https://perceptlayer.com/blog) / [API guides](https://perceptlayer.com/blog/category/api-guides)

# Google AI Mode API: Answers and Follow-ups as JSON

21 Jul 2026 Perceptlayer 7 min read

Google doesn't offer an API for AI Mode, its conversational search answers. `GET /v1/google-search/google-ai-mode-search` returns an AI Mode answer as JSON for a question you pass in `q`, with `hl`, `gl`, `google_domain` and `uule` to set language and location. A `follow_up_token` parameter carries a conversation into its next turn. Every turn is one call at 1 credit, so a three-turn conversation costs 3 credits.

## Key takeaways

-   Google has no public AI Mode API; AI Mode is a Search feature, available in over 200 countries and territories according to Google.
-   `GET /v1/google-search/google-ai-mode-search` needs only `q`, which takes up to 8,192 characters, four times the AI Overview endpoint's 2,048.
-   `follow_up_token` (up to 4,000 characters) links a follow-up question to the turn before it; without it, each call is a fresh conversation.
-   Each turn costs 1 credit on success: 3 credits for a three-turn conversation, 3,000 for 1,000 of them.
-   We haven't recorded an AI Mode response, so this guide gives the request, the parameters and the cost, and names what you need to check in the playground before you build on it.

## Is there an official Google AI Mode API?

No. AI Mode is a tab in Google Search, not a developer product. Google describes it as using a "query fan-out" technique: it splits a question into subtopics and searches for each one at once across several sources, then writes one answer with links ( [Google Search Help](https://support.google.com/websearch/answer/16011537), 2026). Google's developer offerings for generative answers sit elsewhere, in its Gemini API and Vertex AI, which ground a model you call on Google Search results rather than returning the AI Mode answer a searcher sees.

If you want your own model's answer grounded in search, a model API with a search tool is the more direct route, and our guide to [grounding LLM answers with live search](https://perceptlayer.com/blog/ground-agent-answers-live-search) covers that pattern. If you need the answer Google itself gives, for monitoring what AI Mode says about a brand, a product or a topic, the [Google AI Mode Search endpoint](https://perceptlayer.com/apis/google-search/google-ai-mode-search) returns it. Data is collected from publicly available sources and returned as found at the time of the call.

## How do you ask AI Mode a question?

Send a GET request with `q`, the question as a user would type it. Add `hl` and `gl` so the answer matches the language and country you care about. Put your key in the `X-API-Key` header; keys start with `sk_live_`, and the [authentication docs](https://docs.perceptlayer.com/authentication) cover the rest. A first call looks like this:

```bash
curl "https://api.perceptlayer.com/v1/google-search/google-ai-mode-search?q=what+should+I+look+for+in+a+first+road+bike&hl=en&gl=us" \
  -H "X-API-Key: $API_KEY"
```

We haven't run this request for the article and there's no recorded AI Mode response yet, so we won't describe the response fields. Run it in the playground on the [AI Mode endpoint page](https://perceptlayer.com/apis/google-search/google-ai-mode-search) to see the real output.

### Which parameters does it take?

The endpoint takes `q` and five optional parameters. Note the name: it's `q`, while the other Google Search endpoints, including the AI Overview one, use `query`. Types and lengths come from the endpoint definition; defaults aren't documented, so set language and location on every call.

| Parameter | Type | Notes |
| --- | --- | --- |
| `q` | string, required | The question, up to 8,192 characters |
| `hl` | string | Language, 2 characters, for example `en` |
| `gl` | string | Country, 2 characters, for example `us` |
| `google_domain` | string | Up to 100 characters, for example `google.co.uk` |
| `uule` | string | Encoded location, up to 500 characters |
| `follow_up_token` | string | Links a follow-up to the previous turn, up to 4,000 characters |

The long `q` limit matters for AI Mode more than for classic search. People tend to ask it long, specific questions. A question with constraints ("a first road bike under 1,500 dollars for 40 km commutes on rough roads") fits easily.

## How do follow-up questions work?

AI Mode is conversational: in Search you can ask a follow-up and the answer takes the earlier question into account. The endpoint models that with `follow_up_token`. The first call sends only `q`. Each later call sends the new question as `q` plus a token that identifies the conversation so far. Without the token, the follow-up is answered as a new, standalone question.

The token comes from a response, and that's the part we can't show yet. Without a recording we can't name the field that carries it, say whether it changes every turn, or say how long it stays valid. Check these three things in the playground before you build a multi-turn flow:

1.  Which field in the first response holds the token to send back.
2.  Whether the second response returns a new token for the third turn, or the same one.
3.  What a stale or malformed token returns: a fresh answer, or an `invalid_parameters` (422) error.

Here's a Python helper that runs a conversation and leaves the token lookup to you. It's written to the parameters above; we haven't run it against the live API.

```python
import os
import requests

URL = "https://api.perceptlayer.com/v1/google-search/google-ai-mode-search"
HEADERS = {"X-API-Key": os.environ["API_KEY"]}

def converse(questions, get_token, hl="en", gl="us"):
    """Ask questions in order, passing each turn's token to the next.

    get_token(response_json) returns the follow-up token, or None.
    Write it once you've seen a real response in the playground."""
    token, turns = None, []
    for q in questions:
        params = {"q": q, "hl": hl, "gl": gl}
        if token:
            params["follow_up_token"] = token
        r = requests.get(URL, headers=HEADERS, params=params, timeout=90)
        r.raise_for_status()
        body = r.json()
        turns.append({"q": q, "credits": r.headers.get("X-Credits-Used"), "body": body})
        token = get_token(body)
        if not token:
            break
    return turns
```

The helper records `X-Credits-Used` for each turn, so your first run also confirms the cost per turn. It stops if a turn returns no token, rather than silently starting a new conversation. Wrap the request in retries for `rate_limited` and `temporarily_unavailable`, as in [handling web data API errors in Python](https://perceptlayer.com/blog/handle-web-data-api-errors-python).

## What does a conversation cost?

Every call costs 1 credit on success, so a conversation costs one credit per turn. Failed calls cost nothing and return `X-Credits-Used: 0`; every success returns `X-Credits-Used` and `X-Credits-Remaining`. The [credits docs](https://docs.perceptlayer.com/credits) explain billing.

| Job | Calls | Credits |
| --- | --- | --- |
| One question | 1 | 1 |
| A three-turn conversation | 3 | 3 |
| 50 brand questions, daily, one turn each, 30 days | 1,500 | 1,500 |
| 50 brand questions, daily, three turns each, 30 days | 4,500 | 4,500 |

Worked example: 1,000 three-turn conversations are 1,000 × 3 × 1 credit = 3,000 credits. The 1,000 free credits you get every month after verifying an email address cover 333 of them. The daily three-turn brand check, 4,500 credits a month, fits twice in a Starter pack of 10,000 credits with room to spare, and purchased credits last 12 months. See [pricing](https://perceptlayer.com/pricing) for what credits cost.

The helper allows a 90-second client timeout, longer than the 60 seconds after which the API returns `timeout` (504). A request whose reply is lost to a client timeout may still have succeeded and been billed, because requests have no idempotency key. The [rate limits docs](https://docs.perceptlayer.com/rate-limits) cover per-account limits.

## How is AI Mode different from AI Overviews?

They're separate features and separate endpoints. An AI Overview is a summary Google adds above classic results on some searches, when its systems judge it helpful. AI Mode is a separate tab where every question gets a generated answer and you can ask follow-ups. Google says you can also jump from an AI Overview into an AI Mode conversation on mobile ( [Google](https://blog.google/products-and-platforms/products/search/ai-mode-ai-overviews-updates/), 2026).

|  | AI Overview | AI Mode |
| --- | --- | --- |
| Endpoint | [`/v1/google-search/search-ai-overview`](https://perceptlayer.com/apis/google-search/search-ai-overview) | [`/v1/google-search/google-ai-mode-search`](https://perceptlayer.com/apis/google-search/google-ai-mode-search) |
| Query parameter | `query`, up to 2,048 characters | `q`, up to 8,192 characters |
| Follow-ups | No | `follow_up_token` |
| Appears on every query | No, only some | Every question gets an answer |
| Credits | 1 per call | 1 per turn |

For monitoring, use both. AI Overviews are what most searchers see on the classic results page; AI Mode is where people go for longer research questions. The [AI Overview API guide](https://perceptlayer.com/blog/google-ai-overview-api) covers that endpoint and why many queries return no overview. For classic results, see the [Google Search API guide](https://perceptlayer.com/blog/google-search-api-json).

## Where is AI Mode available?

Google says AI Mode is available in over 200 countries and territories and has added languages through 2025 and 2026, including Hindi, Indonesian, Japanese, Korean and Brazilian Portuguese in one 2025 expansion ( [Google](https://blog.google/products-and-platforms/products/search/ai-mode-expands-languages-locations/), 2025). Set `hl` and `gl` to a market where it's offered.

We haven't tested how the endpoint responds when `gl` points at a market without AI Mode, so include that case in your first playground runs if you track several countries. Keep `hl`, `gl` and `google_domain` fixed per market across runs; otherwise day-over-day changes in an answer mix market differences with real ones.

## Can an AI agent call AI Mode?

Yes. The MCP server at `https://api.perceptlayer.com/mcp` exposes `search_endpoints` and `get_endpoint`, which are free catalogue lookups, and `call_endpoint`, which runs `google-search.google-ai-mode-search` and spends 1 credit per turn on success. An agent can ask AI Mode a question and read the answer as JSON.

Treat the answer as one more source, not as ground truth: it's generated, so have the agent follow the linked pages for anything it will state as fact. Setup is in the [AI agents docs](https://docs.perceptlayer.com/ai-agents), and error codes are in the [errors docs](https://docs.perceptlayer.com/errors).

To see the response shape and find the follow-up token, [get a free API key](https://perceptlayer.com/signup) and run a question in the playground on the [Google Search API page](https://perceptlayer.com/apis/google-search).

## APIs in this post

-   [Google Search **1 credit per call** · 7 endpoints](https://perceptlayer.com/apis/google-search)

## Frequently asked questions

### Does Google have an AI Mode API?

No. AI Mode is a Google Search feature with no public API. Google's Gemini API and Vertex AI can ground a model's answer in search results, but they don't return the AI Mode answer a searcher sees. `GET /v1/google-search/google-ai-mode-search` returns that answer as JSON, at 1 credit per successful call.

### How do I ask a follow-up question?

Send the follow-up as `q` with the `follow_up_token` from the previous turn's response. Without the token, the question is answered on its own. We haven't recorded a response yet, so check in the playground which field holds the token and whether it changes from turn to turn before you build a multi-turn flow.

### How much does an AI Mode conversation cost?

Each turn is one call and costs 1 credit on success, so a three-turn conversation costs 3 credits. Failed calls cost nothing. Every account gets 1,000 free credits a month after verifying an email address, and prepaid packs start at 10,000 credits. The [pricing page](https://perceptlayer.com/pricing) has what credits cost.

### Why is the parameter q and not query?

The AI Mode endpoint names its question parameter `q`, while the other Google Search endpoints, including the AI Overview endpoint, use `query`. Sending `query` to the AI Mode endpoint leaves `q` missing, which returns `invalid_parameters` (422) and costs nothing. `q` accepts up to 8,192 characters.

### What happens if a call fails?

You get an HTTP status and a JSON error with a `code`, `message` and `request_id`, and no credits are debited. Rate-limited (429) and temporarily unavailable (503) responses include a `Retry-After` header with the seconds to wait, and a `timeout` (504) error means the source didn't answer within 60 seconds. The [errors docs](https://docs.perceptlayer.com/errors) list every code.

google ai mode google search ai answers follow-up questions json

## More from the blog

1.  [API guides](https://perceptlayer.com/blog/category/api-guides) 10 Aug 2026 Perceptlayer 7 min read
    
    ## [Google Search API: Get Search Results as JSON](https://perceptlayer.com/blog/google-search-api-json)
    
    Call GET /v1/google-search/search for organic results as JSON at 1 credit a call. Parameters, a real recorded response and the cost in credits.
    
2.  [API guides](https://perceptlayer.com/blog/category/api-guides) 16 Jul 2026 Perceptlayer 7 min read
    
    ## [Google AI Overview API: Get AI Overviews as JSON](https://perceptlayer.com/blog/google-ai-overview-api)
    
    Google has no AI Overview API. GET /v1/google-search/search-ai-overview takes a query, hl and gl, costs 1 credit, and suits daily keyword tracking.
    
3.  [API guides](https://perceptlayer.com/blog/category/api-guides) 14 Oct 2026 Perceptlayer 7 min read
    
    ## [Google News API: Search News Articles as JSON](https://perceptlayer.com/blog/google-news-api)
    
    One GET call to /v1/google-news/news returns articles with title, link, source and ISO date as JSON for 1 credit. Parameters, a real response, cost.
