# Fixed reference example. Playground inputs do not update this sample.
curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '[
{
"system_message": "communicate as if we are in a business meeting",
"message_chain": [
{
"role": "user",
"message": "Hello, what’s up?"
},
{
"role": "ai",
"message": "Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?"
}
],
"model_name": "gpt-4.1-mini",
"user_prompt": "provide information on how relevant the amusement park business is in France now"
}
]'curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"message_chain": [
{
"message": "Hello, what’s up?",
"role": "user"
},
{
"message": "Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?",
"role": "ai"
}
],
"model_name": "gpt-4.1-mini",
"system_message": "communicate as if we are in a business meeting",
"user_prompt": "provide information on how relevant the amusement park business is in France now"
}
]
'import requests
url = "https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post"
payload = [
{
"message_chain": [
{
"message": "Hello, what’s up?",
"role": "user"
},
{
"message": "Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?",
"role": "ai"
}
],
"model_name": "gpt-4.1-mini",
"system_message": "communicate as if we are in a business meeting",
"user_prompt": "provide information on how relevant the amusement park business is in France now"
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
message_chain: [
{message: 'Hello, what’s up?', role: 'user'},
{
message: 'Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?',
role: 'ai'
}
],
model_name: 'gpt-4.1-mini',
system_message: 'communicate as if we are in a business meeting',
user_prompt: 'provide information on how relevant the amusement park business is in France now'
}
])
};
fetch('https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'message_chain' => [
[
'message' => 'Hello, what’s up?',
'role' => 'user'
],
[
'message' => 'Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?',
'role' => 'ai'
]
],
'model_name' => 'gpt-4.1-mini',
'system_message' => 'communicate as if we are in a business meeting',
'user_prompt' => 'provide information on how relevant the amusement park business is in France now'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post"
payload := strings.NewReader("[\n {\n \"message_chain\": [\n {\n \"message\": \"Hello, what’s up?\",\n \"role\": \"user\"\n },\n {\n \"message\": \"Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?\",\n \"role\": \"ai\"\n }\n ],\n \"model_name\": \"gpt-4.1-mini\",\n \"system_message\": \"communicate as if we are in a business meeting\",\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"message_chain\": [\n {\n \"message\": \"Hello, what’s up?\",\n \"role\": \"user\"\n },\n {\n \"message\": \"Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?\",\n \"role\": \"ai\"\n }\n ],\n \"model_name\": \"gpt-4.1-mini\",\n \"system_message\": \"communicate as if we are in a business meeting\",\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"message_chain\": [\n {\n \"message\": \"Hello, what’s up?\",\n \"role\": \"user\"\n },\n {\n \"message\": \"Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?\",\n \"role\": \"ai\"\n }\n ],\n \"model_name\": \"gpt-4.1-mini\",\n \"system_message\": \"communicate as if we are in a business meeting\",\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\"\n }\n]"
response = http.request(request)
puts response.read_body{
"cost": 123,
"status_code": 123,
"status_message": "<string>",
"tasks_count": 123,
"tasks_error": 123,
"time": "<string>",
"version": "<string>",
"tasks": [
{
"cost": 123,
"data": {},
"id": "<string>",
"path": [
"<string>"
],
"result_count": 123,
"status_code": 123,
"status_message": "<string>",
"time": "<string>",
"result": {}
}
]
}Setting ‘LLM Responses ChatGPT’ Tasks
Queues a ChatGPT prompt instead of waiting for the reply, returning a task id.
# Fixed reference example. Playground inputs do not update this sample.
curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '[
{
"system_message": "communicate as if we are in a business meeting",
"message_chain": [
{
"role": "user",
"message": "Hello, what’s up?"
},
{
"role": "ai",
"message": "Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?"
}
],
"model_name": "gpt-4.1-mini",
"user_prompt": "provide information on how relevant the amusement park business is in France now"
}
]'curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"message_chain": [
{
"message": "Hello, what’s up?",
"role": "user"
},
{
"message": "Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?",
"role": "ai"
}
],
"model_name": "gpt-4.1-mini",
"system_message": "communicate as if we are in a business meeting",
"user_prompt": "provide information on how relevant the amusement park business is in France now"
}
]
'import requests
url = "https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post"
payload = [
{
"message_chain": [
{
"message": "Hello, what’s up?",
"role": "user"
},
{
"message": "Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?",
"role": "ai"
}
],
"model_name": "gpt-4.1-mini",
"system_message": "communicate as if we are in a business meeting",
"user_prompt": "provide information on how relevant the amusement park business is in France now"
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
message_chain: [
{message: 'Hello, what’s up?', role: 'user'},
{
message: 'Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?',
role: 'ai'
}
],
model_name: 'gpt-4.1-mini',
system_message: 'communicate as if we are in a business meeting',
user_prompt: 'provide information on how relevant the amusement park business is in France now'
}
])
};
fetch('https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'message_chain' => [
[
'message' => 'Hello, what’s up?',
'role' => 'user'
],
[
'message' => 'Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?',
'role' => 'ai'
]
],
'model_name' => 'gpt-4.1-mini',
'system_message' => 'communicate as if we are in a business meeting',
'user_prompt' => 'provide information on how relevant the amusement park business is in France now'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post"
payload := strings.NewReader("[\n {\n \"message_chain\": [\n {\n \"message\": \"Hello, what’s up?\",\n \"role\": \"user\"\n },\n {\n \"message\": \"Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?\",\n \"role\": \"ai\"\n }\n ],\n \"model_name\": \"gpt-4.1-mini\",\n \"system_message\": \"communicate as if we are in a business meeting\",\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"message_chain\": [\n {\n \"message\": \"Hello, what’s up?\",\n \"role\": \"user\"\n },\n {\n \"message\": \"Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?\",\n \"role\": \"ai\"\n }\n ],\n \"model_name\": \"gpt-4.1-mini\",\n \"system_message\": \"communicate as if we are in a business meeting\",\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"message_chain\": [\n {\n \"message\": \"Hello, what’s up?\",\n \"role\": \"user\"\n },\n {\n \"message\": \"Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?\",\n \"role\": \"ai\"\n }\n ],\n \"model_name\": \"gpt-4.1-mini\",\n \"system_message\": \"communicate as if we are in a business meeting\",\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\"\n }\n]"
response = http.request(request)
puts response.read_body{
"cost": 123,
"status_code": 123,
"status_message": "<string>",
"tasks_count": 123,
"tasks_error": 123,
"time": "<string>",
"version": "<string>",
"tasks": [
{
"cost": 123,
"data": {},
"id": "<string>",
"path": [
"<string>"
],
"result_count": 123,
"status_code": 123,
"status_message": "<string>",
"time": "<string>",
"result": {}
}
]
}id. Adds system_message and message_chain over the live endpoint, so a multi-turn conversation can be sent in one task. Wrapped in DataForSEO’s envelope: data in tasks[0].result, outcome in tasks[0].status_code - a rejected request still returns HTTP 200. ⚠️ Not every model supports queuing - check task_post_supported in get_dataforseo_ai_chat_gpt_llm_responses_models. Retrieve with get_dataforseo_ai_chat_gpt_llm_responses_fetch.
Example
curl -X POST "https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '[{"user_prompt": "...", "model_name": "...", "max_output_tokens": "..."}]'
Request contract
- Method and path: POST /apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post
- Availability: enabled
- Request URL template: https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post
- Runtime facts: 6ab8fec17df1d5dcdff2e036dd1eb40587752b774ec040ab4eb0cc6946c3dd3c
{
"operationId": "post_dataforseo_ai_chat_gpt_llm_responses_submit",
"method": "POST",
"path": "/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/task_post",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"example": [
{
"message_chain": [
{
"message": "Hello, what’s up?",
"role": "user"
},
{
"message": "Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?",
"role": "ai"
}
],
"model_name": "gpt-4.1-mini",
"system_message": "communicate as if we are in a business meeting",
"user_prompt": "provide information on how relevant the amusement park business is in France now"
}
],
"items": {
"oneOf": [
{
"example": [
{
"message_chain": [
{
"message": "Hello, what’s up?",
"role": "user"
},
{
"message": "Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?",
"role": "ai"
}
],
"model_name": "gpt-4.1-mini",
"system_message": "communicate as if we are in a business meeting",
"user_prompt": "provide information on how relevant the amusement park business is in France now"
}
],
"properties": {
"force_web_search": {
"description": "<em>force AI agent to use web search</em><br>optional field<br>to enable this parameter, <code>web_search</code> must also be enabled;<br>when enabled, the AI model is forced to access and cite current web information;<br>default value: <code>false</code>;<br><strong>Note:</strong> even if the parameter is set to <code>true</code>, there is no guarantee web sources will be cited in the response <br><strong>Note #2:</strong> not supported in reasoning models",
"type": [
"boolean",
"null"
]
},
"max_output_tokens": {
"description": "<em>maximum number of tokens in the AI response</em><br>optional field<br>minimum value for reasoning models (e.g., <code>reasoning</code> is <code>true</code> in the <a href=\"/v3/ai_optimization/chat_gpt/llm_responses/models/\" target=\"_blank\">Models endpoint</a>): <code>1024</code>;<br>minimum value for non-reasoning models: <code>16</code>;<br>maximum value: <code>4096</code>;<br>default value: <code>2048</code>",
"type": [
"integer",
"null"
]
},
"message_chain": {
"description": "conversation history\noptional field\narray of message objects representing previous conversation turns;\neach object must contain:\nrole string with either user or ai role;\nmessage string with message content (max 500 characters);\nyou can specify maximum of 10 message objects in the array;\nNote: for Perplexity models, messages must strictly alternate between user and AI roles (user → ai);\nexample:\n\"message_chain\": [{\"role\":\"user\",\"message\":\"Hello, what’s up?\"},{\"role\":\"ai\",\"message\":\"Hello! I’m doing well, thank you. How can I assist you today?\"}]",
"items": {
"oneOf": [
{
"properties": {
"message": {
"description": "message text",
"type": [
"string",
"null"
]
},
"role": {
"description": "role of the user from whom the message originates",
"type": [
"string",
"null"
]
}
},
"type": "object"
}
],
"type": [
"object",
"null"
]
},
"type": [
"array",
"null"
]
},
"model_name": {
"description": "<em>name of the AI model</em><br><strong>required field</strong><br><code>model_name</code >consists of the actual model name and version name;<br>if the basic model name is specified, its latest version will be set by default;<br>for example, if <code>gpt-4.1</code> is specified, the <code>gpt-4.1-2025-04-14</code> will be set as <code>model_name</code> automatically;<br>you can receive the list of available LLM models by making a separate request to the <code>https://api.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/models</code>",
"type": "string"
},
"pingback_url": {
"description": "<em>notification URL of a completed task</em><br>optional field<br>when a task is completed we will notify you by GET request sent to the URL you have specified<br>you can use the ‘$id’ string as a <code>$id</code> variable and ‘$tag’ as urlencoded <code>$tag</code> variable. We will set the necessary values before sending the request<br>example:<br><code>http://your-server.com/pingscript?id=$id</code><br><code>http://your-server.com/pingscript?id=$id&tag=$tag</code><br><strong>Note:</strong> special character in <code>pingback_url</code> will be urlencoded;<br>i.a., the <code>#</code> character will be encoded into <code>%23</code><p>learn more on our <a href=\"https://dataforseo.com/help-center/pingbacks-postbacks-with-dataforseo-api\" target=\"_blank\" rel=\"noopener noreferrer\">Help Center</a>",
"type": [
"string",
"null"
]
},
"postback_url": {
"description": "<em>URL for sending task results</em><br>optional field<br>once the task is completed, we will send a POST request with its results compressed in the <code>gzip</code> format to the <code>postback_url</code> you specified<br>you can use the ‘$id’ string as a <code>$id</code> variable and ‘$tag’ as urlencoded <code>$tag</code> variable. We will set the necessary values before sending the request.<br>example:<br><code>http://your-server.com/postbackscript?id=$id</code><br><code>http://your-server.com/postbackscript?id=$id&tag=$tag</code><br><strong>Note:</strong> special character in <code>postback_url</code> will be urlencoded;<br>i.a., the <code>#</code> character will be encoded into <code>%23</code><p>learn more on our <a href=\"https://dataforseo.com/help-center/pingbacks-postbacks-with-dataforseo-api\" target=\"_blank\" rel=\"noopener noreferrer\">Help Center</a>",
"type": [
"string",
"null"
]
},
"system_message": {
"description": "<em>instructions for the AI behaviour</em><br>optional field<br>defines the AI's role, tone, or specific behavior;<br>you can specify <strong>up to 500 characters</strong> in the <code>system_message</code> field",
"type": [
"string",
"null"
]
},
"tag": {
"description": "<em>user-defined task identifier</em><br>optional field<br><em>the character limit is 255</em><br>you can use this parameter to identify the task and match it with the result<br>you will find the specified <code>tag</code> value in the <code>data</code> array of the response",
"type": [
"string",
"null"
]
},
"temperature": {
"description": "<em>randomness of the AI response</em><br>optional field<br>higher values make output more diverse; <br>lower values make output more focused;<br>minimum value: <code>0</code><br>maximum value: <code>2</code><br>default value: <code>0.94</code><br><strong>Note:</strong> not supported in reasoning models",
"type": [
"number",
"null"
]
},
"top_p": {
"description": "<em>diversity of the AI response</em><br>optional field <br>controls diversity of the response by limiting token selection;<br>minimum value: <code>0</code><br>maximum value: <code>1</code> <br>default value: <code>0.92</code><p><strong>Note:</strong> <code>top_p</code> cannot be used together with <code>temperature</code> in the same request",
"type": [
"number",
"null"
]
},
"user_prompt": {
"description": "<em>prompt for the AI model</em><br><strong>required field</strong><br>the question or task you want to send to the AI model;<br>you can specify <strong>up to 500 characters</strong> in the <code>user_prompt</code> field",
"type": "string"
},
"web_search": {
"description": "<em>enable web search</em><br>optional field<br>when enabled, the AI model can access and cite current web information;<br>default value: <code>false</code>;<br><strong>Note:</strong> refer to the <a href=\"https://docs.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/models/\">Models endpoint</a> for a list of models that support <code>web_search</code>;",
"type": [
"boolean",
"null"
]
},
"web_search_city": {
"description": "<em>city name of the location</em><br>optional field<br><strong>Note:</strong> not supported in <code>o3-mini</code>, <code>o1-pro</code>, <code>o1</code> models",
"type": [
"string",
"null"
]
},
"web_search_country_iso_code": {
"description": "<em>ISO country code of the location</em><br>optional field<br>to enable this parameter, <code>web_search</code> must also be enabled;<br>when enabled, the AI model will search the web from the country you specify;<br><strong>Note:</strong> not supported in <code>o3-mini</code>, <code>o1-pro</code>, <code>o1</code> models",
"type": [
"string",
"null"
]
}
},
"type": "object"
}
],
"type": [
"object",
"null"
]
},
"type": "array"
}
}
}
},
"x-aisa-status": "enabled",
"x-aisa-pricing": {
"cost_contract": "response_usd",
"customer_multiplier": 1.0,
"customer_pricing": "provider_cost_multiplier",
"default_request_estimate_usd": 0.701,
"estimate_source": "profile_seed",
"evidence_source": "response_body"
},
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
Usage-based billing; Default request estimate: $0.701 USD (not a fixed price). Account-specific pricing and final settlement may differ. Published reference values are not an account-specific quote or a settled charge. For endpoints supporting X-AISA-Cost-Mode: quote, obtain a free quote for your exact request before execution; reconcile the settled cost with response metadata and Usage Logs. USD amounts use 1,000,000 integer micro-USD per dollar.- Default request reference estimate (USD): 0.701
- Cost contract: response_usd
- Published reference multiplier: 1.0
- Settlement evidence source: response_body
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
force AI agent to use web search
optional field
to enable this parameter, web_search must also be enabled;
when enabled, the AI model is forced to access and cite current web information;
default value: false;
Note: even if the parameter is set to true, there is no guarantee web sources will be cited in the response
Note #2: not supported in reasoning models
maximum number of tokens in the AI response
optional field
minimum value for reasoning models (e.g., reasoning is true in the Models endpoint): 1024;
minimum value for non-reasoning models: 16;
maximum value: 4096;
default value: 2048
conversation history optional field array of message objects representing previous conversation turns; each object must contain: role string with either user or ai role; message string with message content (max 500 characters); you can specify maximum of 10 message objects in the array; Note: for Perplexity models, messages must strictly alternate between user and AI roles (user → ai); example: "message_chain": [{"role":"user","message":"Hello, what’s up?"},{"role":"ai","message":"Hello! I’m doing well, thank you. How can I assist you today?"}]
Show child attributes
Show child attributes
name of the AI model
required fieldmodel_nameconsists of the actual model name and version name;
if the basic model name is specified, its latest version will be set by default;
for example, if gpt-4.1 is specified, the gpt-4.1-2025-04-14 will be set as model_name automatically;
you can receive the list of available LLM models by making a separate request to the https://api.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/models
notification URL of a completed task
optional field
when a task is completed we will notify you by GET request sent to the URL you have specified
you can use the ‘$id’ string as a $id variable and ‘$tag’ as urlencoded $tag variable. We will set the necessary values before sending the request
example:http://your-server.com/pingscript?id=$idhttp://your-server.com/pingscript?id=$id&tag=$tag
Note: special character in pingback_url will be urlencoded;
i.a., the # character will be encoded into %23
learn more on our Help Center
URL for sending task results
optional field
once the task is completed, we will send a POST request with its results compressed in the gzip format to the postback_url you specified
you can use the ‘$id’ string as a $id variable and ‘$tag’ as urlencoded $tag variable. We will set the necessary values before sending the request.
example:http://your-server.com/postbackscript?id=$idhttp://your-server.com/postbackscript?id=$id&tag=$tag
Note: special character in postback_url will be urlencoded;
i.a., the # character will be encoded into %23
learn more on our Help Center
instructions for the AI behaviour
optional field
defines the AI's role, tone, or specific behavior;
you can specify up to 500 characters in the system_message field
user-defined task identifier
optional field
the character limit is 255
you can use this parameter to identify the task and match it with the result
you will find the specified tag value in the data array of the response
randomness of the AI response
optional field
higher values make output more diverse;
lower values make output more focused;
minimum value: 0
maximum value: 2
default value: 0.94
Note: not supported in reasoning models
diversity of the AI response
optional field
controls diversity of the response by limiting token selection;
minimum value: 0
maximum value: 1
default value: 0.92
Note: top_p cannot be used together with temperature in the same request
prompt for the AI model
required field
the question or task you want to send to the AI model;
you can specify up to 500 characters in the user_prompt field
enable web search
optional field
when enabled, the AI model can access and cite current web information;
default value: false;
Note: refer to the Models endpoint for a list of models that support web_search;
city name of the location
optional field
Note: not supported in o3-mini, o1-pro, o1 models
ISO country code of the location
optional field
to enable this parameter, web_search must also be enabled;
when enabled, the AI model will search the web from the country you specify;
Note: not supported in o3-mini, o1-pro, o1 models
[
{
"message_chain": [
{
"message": "Hello, what’s up?",
"role": "user"
},
{
"message": "Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?",
"role": "ai"
}
],
"model_name": "gpt-4.1-mini",
"system_message": "communicate as if we are in a business meeting",
"user_prompt": "provide information on how relevant the amusement park business is in France now"
}
]
Response
Successful operation
total tasks cost, USD
general status code you can find the full list of the response codes here
general informational message you can find the full list of general informational messages here
the number of tasks in the tasks array
the number of tasks in the tasks array returned with an error
total execution time, seconds
the current version of the API
array of tasks
Show child attributes
Show child attributes