ChatGPT
POST /api/v1/search/ai/chatgpt puts one prompt to chatgpt.com the
way a guest in a browser would and returns the reply: its text, the same text as
Markdown and as the page’s HTML, the pages it cites, and the stream the page received while
the reply was arriving. You send no code and no account: the task is dat.ai’s own script,
run as a Browsing API task with the same key, the same billing and the same
task_id in GET /api/v1/browsing/status.
An address the engine will not serve (“Unable to load site”), a challenge page, a page with
no composer, a reply that never came: none of these is an answer. Such an attempt
counts as a failure and the server tries again from elsewhere: first within fanout (the
first reply wins), then with the next round of attempts from browsers and IP addresses
not yet tried. You pay only for the task that returned the reply.
The engine decides for itself whether to search the web for a prompt; a prompt that asks for sources gets them. The request and the reply are the ones every engine shares, see AI Search; what is ChatGPT’s own is below.
What is ChatGPT’s own
| Field | On this engine |
|---|---|
final_url | The guest conversation, https://chatgpt.com/uc/<id> |
sources | One per address, in order of first mention; attribution is the name the engine shows for the page, which is not always its domain |
citations | The citation pills in the text; supporting marks the pages the engine lists as additional to a pill (“+1”) |
raw_stream | Not a Server-Sent Events body: the page fetches the reply as streamed HTML patches (text/vnd.openai.web-mobile-partial+html), handed back as they came |
status: partial | The reply had not finished streaming in timeout_sec; what was on the page is returned |
Refused on the node, so that the request moves on to another browser: an address the engine will not serve (“Unable to load site”, roughly one node in four or five), a challenge page, a page with no composer, a reply that had not begun after 30 seconds.
Example
curl -sS -X POST "https://llm.dat.ai/api/v1/search/ai/chatgpt" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "What is the capital of Australia and how big is its population? Cite sources.",
"locale": "en-GB",
"raw_stream": false
}'Response (200), as the engine answered it (the sources and citations cut to two of four;
raw_stream is absent because the request turned it off):
{
"task_id": "web:c90aee70-6bf2-4867-a763-eb743370d13b",
"provider": "chatgpt",
"prompt": "What is the capital of Australia and how big is its population? Cite sources.",
"final_url": "https://chatgpt.com/uc/6aad0701-6e8c-83ea-8848-e616011b93f9",
"status": "complete",
"answer": {
"text": "The capital of Australia is Canberra, located in the Australian Capital Territory (ACT).\n\nAs for population:\n\nCanberra (Greater Capital City Statistical Area): about 484,630 people as of 30 June 2025, according to the Australian Bureau of Statistics (ABS).\n\nAustralian Capital Territory overall: about 489,700 people as of 31 March 2026. ...",
"markdown": "The capital of Australia is **Canberra**, located in the Australian Capital Territory (ACT).\n\nAs for population:\n\n- **Canberra (Greater Capital City Statistical Area):** about **484,630 people** as of **30 June 2025**, according to the Australian Bureau of Statistics (ABS). [1]\n- **Australian Capital Territory overall:** about **489,700 people** as of **31 March 2026**. [2]\n...",
"html": "<p>The capital of Australia is <strong>Canberra</strong>, located in the Australian Capital Territory (ACT).</p> ..."
},
"web_search": true,
"sources": [
{
"url": "https://www.abs.gov.au/statistics/people/population/regional-population/2024-25",
"title": "Regional population, 2024-25 financial year | Australian Bureau of Statistics",
"domain": "abs.gov.au",
"attribution": "Australian Bureau of Statistics"
},
{
"url": "https://www.abs.gov.au/statistics/people/population/national-state-and-territory-population/mar-2026",
"title": "National, state and territory population, March 2026 | Australian Bureau of Statistics",
"domain": "abs.gov.au",
"attribution": "Australian Bureau of Statistics"
}
],
"citations": [
{
"url": "https://www.abs.gov.au/statistics/people/population/regional-population/2024-25",
"title": "Regional population, 2024-25 financial year | Australian Bureau of Statistics",
"source": 1,
"text": "Canberra (Greater Capital City Statistical Area): about 484,630 people as of 30 June 2025, according to the Australian Bureau of Statistics (ABS).",
"supporting": false
},
{
"url": "https://www.abs.gov.au/statistics/people/population/national-state-and-territory-population/mar-2026",
"title": "National, state and territory population, March 2026 | Australian Bureau of Statistics",
"source": 2,
"text": "Australian Capital Territory overall: about 489,700 people as of 31 March 2026.",
"supporting": false
}
]
}Errors. The body is always { "error": "..." }; these are the answers as the server gives them:
// 400 — no prompt, a value out of range, a field the endpoint does not know
{ "error": "prompt is required" }
{ "error": "attempts must be between 1 and 5" }
{ "error": "locale must be a language tag such as en-GB or de" }
{ "error": "Invalid input data" }
// 401 — no key, or a wrong one
{ "error": "Authentication required: missing Authorization header. Please provide Authorization header with Bearer token format: 'Authorization: Bearer <your-api-key>'" }
// 402 — a quota at zero and no balance to cover it (see Account & Balance)
{ "error": "Insufficient balance: the browser_seconds quota is used up and there is no USD balance to cover overage; top up in the dashboard (https://dash.dat.ai) or check GET /api/v1/account/balance", "code": "insufficient_balance", "exhausted": "browser_seconds" }
// 404 — an engine that does not exist
{ "error": "unknown answer engine" }
// 502 — every browser tried was refused, or none produced a reply
{ "error": "no reply: the engine refused this browser" }
{ "error": "no reply: the engine gave no reply" }
{ "error": "no reply: the request could not be completed" }
// 504 — no answer within the attempts' time
{ "error": "no reply: no answer in time" }