Google AI Mode

Query Google's AI Mode — conversational AI answers with citations

POSThttps://api.anakin.io/v1/wire/task

Google AI Mode is the dedicated conversational AI answer surface. Send a prompt and get the answer with its citations, plus any shopping/local modules Google attaches. Run it with the ai_mode action on POST /v1/wire/task.

Catalog: google_ai_mode · action_id: ai_mode · Credits: 2 / call · Auth: none


Request Body

{
  "action_id": "ai_mode",
  "params": { "prompt": "best CRM for small teams", "country": "us" }
}
ParameterTypeDescription
action_id requiredstringSet to ai_mode
params.prompt requiredstringThe prompt to send to Google AI Mode (max 4096 chars)
params.additional_promptstringOptional follow-up in the same conversation
params.countrystring2-letter country code to run the request from
params.include_htmlbooleanAlso capture the rendered AI Mode page, as a downloadable file linked under data.html_link (answer_html itself stays empty). Default false
params.devicestringUser-agent profile (desktop, desktop_chrome, mobile, …). Default desktop

Code Examples

curl -X POST http://staging-alb-1217701800.ap-south-1.elb.amazonaws.com/v1/wire/task \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "action_id": "ai_mode",
    "params": { "prompt": "best CRM for small teams", "country": "us" }
  }'

Response

202 Accepted
{ "status": "processing", "job_id": "…", "poll_url": "/v1/wire/jobs/…" }

Poll GET /v1/wire/jobs/{id} until status: "completed":

200 OK
{
  "status": "completed",
  "credits_used": 2,
  "execution_ms": 21652,
  "data": {
    "status": "ok",
    "data": {
      "answer_text": "…", "answer_text_markdown": "…", "answer_text_markdown_cited": "…",
      "answer_html": "", "answer_section_html": "",
      "citations": [], "references": [], "search_sources": [], "source_count": 6,
      "claim_references": [
        { "text": "HubSpot is the easiest platform for beginners…", "start": 0, "end": 46,
          "references": [{ "source": "Zapier", "url": "https://zapier.com/…", "more": 2, "source_index": 1 }] }
      ],
      "products": [], "businesses": [], "ads": null, "engine": "ai_mode"
    },
    "meta": { "action_id": "ai_mode", "catalog_slug": "google_ai_mode", "envelope_version": "v1" }
  }
}
FieldTypeDescription
data.data.answer_textstringThe answer, also as answer_text_markdown. answer_text_markdown_cited is the same markdown with a [n] marker after each cited sentence (n = source_index + 1)
data.data.additional_answer_textstringThe answer to additional_prompt, when you send one (also additional_answer_html with include_html)
data.data.answer_text_rawstringThe raw, unprocessed answer — keeps AI Mode's inline citation-chip labels and placeholder tokens that answer_text strips out
data.data.follow_up_textstring | nullThe reader-addressed closing/follow-up questions, split out of answer_text
data.data.citationsarraySources cited in the answer
data.data.adsobject or nullText ads on the page: { top: [...], bottom: [...], count }; null when none were shown
data.data.referencesarrayThe cited sources in { url, title, attribution, domain } shape
data.data.links_attachedarrayThe cited sources as a flat list in reading order: { url, text, position }
data.data.inline_linksarrayLinks woven into the answer prose, in reading order: { url, text, domain, position }
data.data.claim_referencesarrayWhere each source is cited in the answer body. One entry per cited sentence: text, its character offsets in answer_text (start/end), and references: [{ source, url, more, source_index }] — the chip's lead source, more = the "+N" grouped-source count, and source_index into citations[]
data.data.source_countnumberNumber of cited sources
data.data.search_sourcesarraySources considered during search
data.data.search_sources_detailedarrayThe same sources as objects with rank and cited
data.data.web_search_triggeredbooleanWhether AI Mode actually ran a web search for this answer
data.data.productsarrayShopping modules for commercial-intent queries
data.data.businessesarrayLocal results for local-intent queries

claim_references populates on every answer that cites (no parameter needed). A chip surfaces its lead source and the "+N" count; the extra grouped URLs load on click and aren't in the response. With include_html, answer_html is empty on the browser path — the rendered page ships as a downloadable file via data.html_link (durable). AI Mode is geo-sensitive — availability and phrasing vary by country. Billed only on success.