ChatGPT LLM Responses: Task Post

Beta
Queue prompts for a ChatGPT model at the lower queued base fee, then collect the answers.
POST/v1/ai/chat_gpt/llm_responses/task_post

Beta. The parser for this endpoint was written from the upstream format and has not yet been checked against a live response. Field shapes may change; tell us if you see a mismatch.

Open as Markdown
On this page

Price

Priceanswer
Standard queue
$0.00018
Priority queue
$0.00054

Base fee per answer by queue, plus the model's token and search cost at list price.

Description

Post up to 100 tasks; each comes back with 20100 and a task id. Answers appear in tasks_ready when done. priority: 2 uses the priority queue at the priority base fee.

Billing. Each answer costs our base fee for the mode plus the model's token and search cost at the model's published list price, reported as money_spent. A failed, empty or refused answer costs $0. Before the call, the wallet check reserves the base fee plus a conservative token estimate (or your max_cost).

Token prices for ChatGPT models:

ModelInput per 1M tokensOutput per 1M tokensWeb search per 1,000Reasoning
gpt-5$1.25$10.0$10.0yes
gpt-5-mini$0.25$2.0$10.0yes
gpt-5-nano$0.05$0.4$10.0yes
gpt-4.1$2.0$8.0$25.0no
gpt-4.1-mini$0.4$1.6$25.0no
gpt-4o$2.5$10.0$25.0no
gpt-4o-mini$0.15$0.6$25.0no

Answers aren't cached: each call is a new sample. Prompts and answers are added to the AI-answer dataset unless your organization has opted out.

Beta. Queued tasks go through the model vendor's batch interface, which we wrote from its documentation and haven't checked against live batch responses yet. When a batch can't be submitted, the task runs on the standard interface instead; the result shape is the same either way.

Request

Endpoint
POST https://api.dataforgaio.com/v1/ai/chat_gpt/llm_responses/task_post
Authentication
HTTP Basic auth: any login, with your dg_ API key as the password. A Bearer header with the key also works. Create a key.
Body
JSON array of task objects, up to 100 tasks per requestMode: Task Post

Fields (per task)

  • user_promptstringrequired
    The prompt, up to 500 characters.
    Max500ExampleWhich running shoe brands are best for wide feet?
  • model_namestringoptional
    A model id from /v1/ai/chat_gpt/llm_responses/models. Dated ids such as gpt-4.1-2025-04-14 resolve to their base model. Leave it out to use the default model.
    Defaultgpt-5One ofgpt-5gpt-5-minigpt-5-nanogpt-4.1gpt-4.1-minigpt-4ogpt-4o-miniExamplegpt-4o-mini
  • system_messagestringoptional
    Instructions sent before the prompt, up to 500 characters.
    Max500ExampleAnswer in two sentences.
  • message_chainarray<object>optional
    Earlier turns of the conversation, up to 10. They alternate user and ai, start with user and end with ai; each message is up to 500 characters.
    Max10
    Show 2 child fields
    • rolestringrequired
      Who said it.
      One ofuseraiExampleuser
    • messagestringrequired
      What was said.
      Max500ExampleI run trails twice a week.
  • max_output_tokensintegeroptional
    Most tokens the answer may use, up to 4,096. The minimum is 16, or 1,024 for reasoning models.
    Default2048Min16Max4096Example1024
  • temperaturenumberoptional
    Sampling temperature, 0.0 to 2.0. Send this or top_p, not both. Ignored by reasoning models.
    Min0Max2Example0.4
  • top_pnumberoptional
    Nucleus sampling, 0 to 1. Send this or temperature, not both.
    Min0Max1Example0.9
  • Two-letter country the web search should favor.
    Min2Max2ExampleUS
  • web_search_citystringoptional
    City the web search should favor, up to 100 characters.
    Max100ExampleDenver
  • max_costnumberoptional
    The most this task may be charged, in USD. The wallet check reserves this amount instead of our token estimate, and the charge is capped at it. Before the model is called, max_output_tokens is lowered (and web search turned off, unless forced or always on) so the most the answer can cost fits; when even the prompt can't fit, the task returns 40501 at $0.
    Min0Example0.01
  • priorityintegeroptional
    Queue for this task: 1 is the standard queue, 2 the priority queue (faster, priced higher).
    Default1One of12Example1
  • tagstringoptional
    Your own label for the task, up to 255 characters. Returned by tasks_ready.
    Max255Exampleweekly-rank-check
  • pingback_urlstringoptional
    We send a GET to this http(s) URL when the task finishes. $id and $tag in the URL are replaced with the task id and tag. Only public hosts are called and redirects aren't followed.
    Max2000Examplehttps://hooks.example.com/done?id=$id&tag=$tag
  • postback_urlstringoptional
    We POST the finished task, in the task_get envelope, to this http(s) URL. Only public hosts are called and redirects aren't followed.
    Max2000Examplehttps://hooks.example.com/results
  • postback_datastringoptional
    Result format sent to postback_url. Defaults to advanced when postback_url is set.
    One ofregularadvancedhtmlExampleadvanced

Response

Shape: v3 task envelope. Expand a field to see its children; every field has a link anchor.

  • versionstring
    Response format version, for example 0.1.20261203.
    Example0.1.20261203
  • Status of the request as a whole. 20000 when it was accepted; each task has its own status_code.
    Example20000
  • Plain-language request status.
    ExampleOk.
  • timestring
    Time the whole request took, for example 1.8410 sec.
    Example0.4210 sec.
  • costnumber
    Sum of every task's cost, in USD.
    Example0
  • Number of tasks in tasks.
    Example1
  • Tasks whose status_code is 40000 or higher.
    Example0
  • tasksarray<object>
    One entry per task you sent, in the order you sent them.
    Show 14 child fields
    • idstring
      Task id (a UUID). For task_post, use it with task_get.
      Example8cbb5b5c-8e15-5c82-9959-45f93cdad009
    • Outcome of this task. 20000 means data came back; 20100 means queued. See the status codes table.
      Example20100
    • Plain-language status. For 40501 it names the field that failed.
      ExampleTask Created.
    • timestring
      Time this task took on our side, for example 1.8203 sec.
      Example0.4210 sec.
    • costnumber
      What this task was charged, in USD. 0 when it returned no data.
      Example0
    • Number of entries in result.
      Example0
    • patharray<string>
      The route this task ran on, split into segments, starting with v1.
      Example["v1","ai","chat_gpt"]
    • dataobject
      The task you sent, echoed back. Utility routes echo their query parameters.
      Example{"user_prompt":"Which running shoe brands are best for wide feet?","model_name":"gpt-4o-mini","web_search":true,"web_search_country_iso_code":"US","tag":"wide-feet-weekly"}
    • resultnull
      Always null for task_post.
    • receipt_idstring|null
      Id of the ledger receipt for this task: what was fetched, at which level, and what was charged. Null for utility routes and failed checks.
    • fetch_levelstring|null
      The fetch level that delivered the data: standard, rendered or protected. Null when the route doesn't fetch pages or nothing was fetched.
      One ofstandardrenderedprotected
    • upgradedboolean
      True when Auto-upgrade moved the request past the included level (or, for SERP, to the live path) and the charge reflects that.
      Examplefalse
    • upgrade_reasonstring|null
      Why the request upgraded, in our level names and HTTP facts, for example 403 at standard; challenge page at rendered. Null when it didn't upgrade.
    • cache_hitboolean
      True when the data came from the shared result cache instead of a new fetch.
      Examplefalse

Errors

CodeWhen
40100No credentials were sent (HTTP 401).
40101The API key is missing, malformed or revoked (HTTP 401).
40202Too many requests for this key (HTTP 429, with Retry-After).
40503The body isn't a JSON array of task objects, or the method isn't POST (HTTP 400 or 405).
40006More than 100 tasks in one POST (HTTP 400).
40210Wallet balance below the worst case this POST could cost (HTTP 402).
40501A task field failed validation. Returned per task; other tasks still run.
Tasks that end in an error are not billed. All status codes

Migrating

Replaces DataForSEO /v3/ai_optimization/chat_gpt/llm_responses/task_post. The request body and response envelope match: change the base URL to https://api.dataforgaio.com/v1 and use your dg_ key as the password.