ChatGPT

Query ChatGPT via Wire — the answer, citations, and web sources it used

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

Run a prompt against ChatGPT and get the full answer with the web sources it cited when search is on — the complete answer, exactly as ChatGPT renders it. Run it with the chatgpt action on POST /v1/wire/task.

Catalog: ai-assistants · action_id: chatgpt · Credits: 2 / call (6 with ads: true) · Auth: none


Request Body

{
  "action_id": "chatgpt",
  "params": {
    "prompt": "best CRM for small teams",
    "web_search": true,
    "country": "us"
  }
}
ParameterTypeDescription
action_id requiredstringSet to chatgpt
params.prompt requiredstringThe prompt to send to ChatGPT (max 4096 chars)
params.web_searchbooleanRequest live web search. The response reports whether it actually ran via web_search_triggered. Default false
params.messagesstring[]Optional earlier conversation turns (up to 5, oldest first, ≤4000 chars each). ChatGPT answers each in order, then your prompt, in one conversation — earlier replies come back in conversation[]. Each turn adds latency and costs 2 credits, i.e. (messages + 1) × 2
params.include_htmlbooleanAlso include answer_html + answer_section_html (rendered DOM, ~0.5 MB). Default false
params.countrystring2-letter country code to run the request from (e.g. us, in). Default in
params.statestringUS state 2-letter code (e.g. ca, ny) — only with country: "us", not with include_html. ChatGPT then answers as a user in that state
params.adsbooleanCapture ChatGPT's ads reliably: the conversation is primed so the answer carries the ad unit OpenAI serves. Billed at 6 credits instead of 2. Default false
params.legacybooleanOnly with include_html: answer on ChatGPT's legacy desktop page, so the snapshot also carries model, web_search_queries, entities and citation_anchors. Default false

Any sponsored result ChatGPT shows is returned in data.data.ads. ChatGPT serves ads on only a small share of plain prompts; to capture them reliably, set "ads": true (6 credits per call).


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": "chatgpt",
    "params": { "prompt": "best CRM for small teams", "web_search": true, "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": 17889,
  "data": {
    "status": "ok",
    "data": {
      "prompt": "best CRM for small teams",
      "title": "Best CRMs for small teams",
      "answer_text": "For small teams, the strongest options are …",
      "answer_text_markdown": "…",
      "citations": [
        { "ref": 1, "url": "https://…", "title": "…", "domain": "…", "position": 1,
          "ref_type": "web", "description": "…", "result_source": "search", "date_published": "…", "cited": true }
      ],
      "citation_anchors": [
        { "start_idx": 0, "end_idx": 58, "urls": ["https://…"], "refs": ["turn0search0"] }
      ],
      "inline_links": [],
      "search_sources": [], "web_search_queries": ["best CRM small teams 2026"], "web_search_triggered": true,
      "ads": { "name": null, "url": null, "carousel_cards": null, "served": false }, "ads_all": [], "shopping": [], "entities": [], "recommendations": [], "business_locations": [],
      "model": "gpt-…", "country": "us", "timestamp": "…"
    },
    "meta": { "action_id": "chatgpt", "catalog_slug": "ai-assistants", "envelope_version": "v1" }
  }
}
FieldTypeDescription
data.data.answer_textstringThe plain-text answer (also answer_text_markdown, and answer_html when include_html)
data.data.conversationarrayOnly when you send messages: one entry per earlier turn, oldest first — { prompt, answer_text, ads, ads_all }
data.data.answer_text_rawstringThe raw, unprocessed answer — keeps ChatGPT's inline citation-chip labels and placeholder tokens that answer_text strips out
data.data.citationsarray{ ref, url, title, domain, position, ref_type, description, result_source, date_published, cited }
data.data.recommendationsarrayRelated products or items the engine recommends alongside the answer
data.data.shoppingarrayShopping module for commercial-intent queries — products with titles, prices and links
data.data.citation_anchorsarrayWhere each source is cited in the answer body. One entry per cited span: character range in answer_text (start_idx/end_idx), the source urls cited there and their refs (ChatGPT's own reference ids, e.g. "turn0search0" — strings, not numbers)
data.data.links_attachedarrayThe cited sources as a flat list in reading order: { url, text, position }
data.data.referencesarrayThe cited sources in { url, title, attribution, domain } shape
data.data.inline_linksarrayLinks woven into the answer prose, in reading order — { url, text, domain, position }
data.data.entitiesarrayNamed entities (brands, products, people) ChatGPT surfaced in the answer
data.data.search_sourcesarraySources ChatGPT pulled during web search
data.data.web_search_queriesstring[]The queries ChatGPT actually searched
data.data.web_search_querystringThe search query ChatGPT ran
data.data.web_search_triggeredbooleanWhether live search ran
data.data.adsobjectThe first sponsored result ChatGPT showed — name, url, carousel_cards (title, body, target), served. Fields are null and served is false when no ad was shown
data.data.ads_allarrayEvery sponsored result served in the conversation
data.data.response_rawarrayChatGPT's raw response stream, as a list of the stream's events, verbatim. Not a stable contract — its format can change without notice; use the structured fields instead

Set web_search: true to force live sources — without it ChatGPT may answer from model knowledge with no citations. Billed only on success.