ChatGPT
Query ChatGPT via Wire — the answer, citations, and web sources it used
https://api.anakin.io/v1/wire/taskRun 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"
}
}| Parameter | Type | Description |
|---|---|---|
action_id required | string | Set to chatgpt |
params.prompt required | string | The prompt to send to ChatGPT (max 4096 chars) |
params.web_search | boolean | Request live web search. The response reports whether it actually ran via web_search_triggered. Default false |
params.messages | string[] | 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_html | boolean | Also include answer_html + answer_section_html (rendered DOM, ~0.5 MB). Default false |
params.country | string | 2-letter country code to run the request from (e.g. us, in). Default in |
params.state | string | US 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.ads | boolean | Capture 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.legacy | boolean | Only 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" }
}'import requests
res = requests.post(
'https://api.anakin.io/v1/wire/task',
headers={'X-API-Key': 'your_api_key'},
json={
'action_id': 'chatgpt',
'params': {'prompt': 'best CRM for small teams', 'web_search': True, 'country': 'us'},
},
)
job_id = res.json()['job_id']const res = await fetch('http://staging-alb-1217701800.ap-south-1.elb.amazonaws.com/v1/wire/task', {
method: 'POST',
headers: { 'X-API-Key': 'your_api_key', 'Content-Type': 'application/json' },
body: JSON.stringify({
action_id: 'chatgpt',
params: { prompt: 'best CRM for small teams', web_search: true, country: 'us' },
}),
});
const { job_id } = await res.json();Response
202 Accepted{ "status": "processing", "job_id": "…", "poll_url": "/v1/wire/jobs/…" }Poll GET /v1/wire/jobs/{id} until status: "completed":
{
"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" }
}
}| Field | Type | Description |
|---|---|---|
data.data.answer_text | string | The plain-text answer (also answer_text_markdown, and answer_html when include_html) |
data.data.conversation | array | Only when you send messages: one entry per earlier turn, oldest first — { prompt, answer_text, ads, ads_all } |
data.data.answer_text_raw | string | The raw, unprocessed answer — keeps ChatGPT's inline citation-chip labels and placeholder tokens that answer_text strips out |
data.data.citations | array | { ref, url, title, domain, position, ref_type, description, result_source, date_published, cited } |
data.data.recommendations | array | Related products or items the engine recommends alongside the answer |
data.data.shopping | array | Shopping module for commercial-intent queries — products with titles, prices and links |
data.data.citation_anchors | array | Where 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_attached | array | The cited sources as a flat list in reading order: { url, text, position } |
data.data.references | array | The cited sources in { url, title, attribution, domain } shape |
data.data.inline_links | array | Links woven into the answer prose, in reading order — { url, text, domain, position } |
data.data.entities | array | Named entities (brands, products, people) ChatGPT surfaced in the answer |
data.data.search_sources | array | Sources ChatGPT pulled during web search |
data.data.web_search_queries | string[] | The queries ChatGPT actually searched |
data.data.web_search_query | string | The search query ChatGPT ran |
data.data.web_search_triggered | boolean | Whether live search ran |
data.data.ads | object | The 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_all | array | Every sponsored result served in the conversation |
data.data.response_raw | array | ChatGPT'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: trueto force live sources — without it ChatGPT may answer from model knowledge with no citations. Billed only on success.