# 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/live \
--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?"
}
],
"max_output_tokens": 200,
"temperature": 0.3,
"top_p": 0.5,
"model_name": "gpt-4.1-mini",
"web_search": true,
"web_search_country_iso_code": "FR",
"web_search_city": "Paris",
"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/live \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"max_output_tokens": 200,
"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",
"temperature": 0.3,
"top_p": 0.5,
"user_prompt": "provide information on how relevant the amusement park business is in France now",
"web_search": true,
"web_search_city": "Paris",
"web_search_country_iso_code": "FR"
}
]
'import requests
url = "https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/live"
payload = [
{
"max_output_tokens": 200,
"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",
"temperature": 0.3,
"top_p": 0.5,
"user_prompt": "provide information on how relevant the amusement park business is in France now",
"web_search": True,
"web_search_city": "Paris",
"web_search_country_iso_code": "FR"
}
]
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([
{
max_output_tokens: 200,
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',
temperature: 0.3,
top_p: 0.5,
user_prompt: 'provide information on how relevant the amusement park business is in France now',
web_search: true,
web_search_city: 'Paris',
web_search_country_iso_code: 'FR'
}
])
};
fetch('https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/live', 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/live",
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([
[
'max_output_tokens' => 200,
'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',
'temperature' => 0.3,
'top_p' => 0.5,
'user_prompt' => 'provide information on how relevant the amusement park business is in France now',
'web_search' => true,
'web_search_city' => 'Paris',
'web_search_country_iso_code' => 'FR'
]
]),
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/live"
payload := strings.NewReader("[\n {\n \"max_output_tokens\": 200,\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 \"temperature\": 0.3,\n \"top_p\": 0.5,\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\",\n \"web_search\": true,\n \"web_search_city\": \"Paris\",\n \"web_search_country_iso_code\": \"FR\"\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/live")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"max_output_tokens\": 200,\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 \"temperature\": 0.3,\n \"top_p\": 0.5,\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\",\n \"web_search\": true,\n \"web_search_city\": \"Paris\",\n \"web_search_country_iso_code\": \"FR\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/live")
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 \"max_output_tokens\": 200,\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 \"temperature\": 0.3,\n \"top_p\": 0.5,\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\",\n \"web_search\": true,\n \"web_search_city\": \"Paris\",\n \"web_search_country_iso_code\": \"FR\"\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": [
{
"datetime": "<string>",
"fan_out_queries": [
"<string>"
],
"input_tokens": 123,
"items": [
{
"sections": [
{
"annotations": [
{
"direct_url": "<string>",
"end_index": 123,
"start_index": 123,
"text": "<string>",
"title": "<string>",
"url": "<string>"
}
],
"text": "<string>",
"type": "<string>"
}
],
"type": "<string>"
}
],
"model_name": "<string>",
"money_spent": 123,
"output_tokens": 123,
"reasoning_tokens": 123,
"web_search": true
}
]
}
]
}Live ChatGPT LLM Responses
Sends a user_prompt to a ChatGPT model and returns its reply, synchronously.
# 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/live \
--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?"
}
],
"max_output_tokens": 200,
"temperature": 0.3,
"top_p": 0.5,
"model_name": "gpt-4.1-mini",
"web_search": true,
"web_search_country_iso_code": "FR",
"web_search_city": "Paris",
"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/live \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"max_output_tokens": 200,
"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",
"temperature": 0.3,
"top_p": 0.5,
"user_prompt": "provide information on how relevant the amusement park business is in France now",
"web_search": true,
"web_search_city": "Paris",
"web_search_country_iso_code": "FR"
}
]
'import requests
url = "https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/live"
payload = [
{
"max_output_tokens": 200,
"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",
"temperature": 0.3,
"top_p": 0.5,
"user_prompt": "provide information on how relevant the amusement park business is in France now",
"web_search": True,
"web_search_city": "Paris",
"web_search_country_iso_code": "FR"
}
]
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([
{
max_output_tokens: 200,
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',
temperature: 0.3,
top_p: 0.5,
user_prompt: 'provide information on how relevant the amusement park business is in France now',
web_search: true,
web_search_city: 'Paris',
web_search_country_iso_code: 'FR'
}
])
};
fetch('https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/live', 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/live",
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([
[
'max_output_tokens' => 200,
'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',
'temperature' => 0.3,
'top_p' => 0.5,
'user_prompt' => 'provide information on how relevant the amusement park business is in France now',
'web_search' => true,
'web_search_city' => 'Paris',
'web_search_country_iso_code' => 'FR'
]
]),
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/live"
payload := strings.NewReader("[\n {\n \"max_output_tokens\": 200,\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 \"temperature\": 0.3,\n \"top_p\": 0.5,\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\",\n \"web_search\": true,\n \"web_search_city\": \"Paris\",\n \"web_search_country_iso_code\": \"FR\"\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/live")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"max_output_tokens\": 200,\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 \"temperature\": 0.3,\n \"top_p\": 0.5,\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\",\n \"web_search\": true,\n \"web_search_city\": \"Paris\",\n \"web_search_country_iso_code\": \"FR\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/live")
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 \"max_output_tokens\": 200,\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 \"temperature\": 0.3,\n \"top_p\": 0.5,\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\",\n \"web_search\": true,\n \"web_search_city\": \"Paris\",\n \"web_search_country_iso_code\": \"FR\"\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": [
{
"datetime": "<string>",
"fan_out_queries": [
"<string>"
],
"input_tokens": 123,
"items": [
{
"sections": [
{
"annotations": [
{
"direct_url": "<string>",
"end_index": 123,
"start_index": 123,
"text": "<string>",
"title": "<string>",
"url": "<string>"
}
],
"text": "<string>",
"type": "<string>"
}
],
"type": "<string>"
}
],
"model_name": "<string>",
"money_spent": 123,
"output_tokens": 123,
"reasoning_tokens": 123,
"web_search": true
}
]
}
]
}user_prompt to a ChatGPT model and returns its reply, synchronously. model_name picks the model - see get_dataforseo_ai_chat_gpt_llm_responses_models, and an unlisted name is rejected outright. max_output_tokens, temperature and top_p behave as they do on the vendor’s own API, and web_search or force_web_search let it browse. Returns model_name, input_tokens, output_tokens, reasoning_tokens, web_search, money_spent, datetime, items and fan_out_queries. 💰 Billed per call at a flat rate, whatever the reply length. Wrapped in DataForSEO’s envelope: data in tasks[0].result, outcome in tasks[0].status_code - a rejected request still returns HTTP 200. ⚠️ This is a general LLM call routed through a data provider, not an SEO measurement. If you want to know what ChatGPT tells users about a brand, post_dataforseo_ai_chat_gpt_llm_scraper_live reproduces the consumer experience instead.
Example
curl -X POST "https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/live" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '[{"user_prompt": "...", "model_name": "...", "max_output_tokens": "..."}]'
// Copy this whole block into Claude Code, Codex, Cursor or any coding agent.
// It carries everything needed to connect, authorize and run this example —
// no key to paste, one click of Allow in the browser.
{
"calls": [
{
"call_id": "1",
"tool": "post_dataforseo_ai_chat_gpt_llm_responses_live",
"arguments": {}
}
]
}
// ── for the agent ─────────────────────────────────────────────────────────
// Register the AIsa MCP server, then call its `batch_quote` tool with the JSON above.
// name aisa
// endpoint https://mcp.aisa.one/mcp
// transport streamable-http
// auth OAuth. The server publishes RFC 9728 metadata, so open a
// browser and the user clicks Allow once — nothing to paste.
// If AISA_API_KEY is set, send it as a bearer header instead.
// Use your own MCP mechanism, not a hand-edited config file:
// Codex codex mcp add aisa --url https://mcp.aisa.one/mcp
// Claude Code claude mcp add --transport http -s user aisa https://mcp.aisa.one/mcp
// Cursor / VS Code a "url" entry for https://mcp.aisa.one/mcp in the MCP config
// The server reaches https://mcp.aisa.one/servers worth of APIs through a few meta
// tools: search, list_categories, get_details, batch_quote, batch_use.
// search, get_details and batch_quote are free; batch_use is billed per
// call. This operation's full contract — every argument, the response
// shape, the price and the pitfalls — is at
// https://aisa.one/docs/api-reference/dataforseo/post_dataforseo-ai-optimization-chat-gpt-llm-responses-live.md
// Show me the quoted cost. Once I approve, run the same calls with
// batch_use and show me the result.
https://mcp.aisa.one/mcp — Claude
Code, Codex, Cursor, VS Code and the rest. Authorization is OAuth: the client
opens a browser, you click Allow once, and there is no key to paste. Your
agent then reaches every endpoint through a few meta tools: search,
list_categories, get_details and batch_quote are free, batch_use is
billed per call. Setup per client is in
Connect via MCP; the live tool list and what each call
costs are on aisa.one/mcp.Request contract
- Method and path: POST /apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/live
- Availability: enabled
- Request URL template: https://api.aisa.one/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/live
- Runtime facts: 6ab8fec17df1d5dcdff2e036dd1eb40587752b774ec040ab4eb0cc6946c3dd3c
{
"operationId": "post_dataforseo_ai_chat_gpt_llm_responses_live",
"method": "POST",
"path": "/apis/v1/dataforseo/ai_optimization/chat_gpt/llm_responses/live",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"example": [
{
"max_output_tokens": 200,
"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",
"temperature": 0.3,
"top_p": 0.5,
"user_prompt": "provide information on how relevant the amusement park business is in France now",
"web_search": true,
"web_search_city": "Paris",
"web_search_country_iso_code": "FR"
}
],
"items": {
"oneOf": [
{
"example": [
{
"max_output_tokens": 200,
"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",
"temperature": 0.3,
"top_p": 0.5,
"user_prompt": "provide information on how relevant the amusement park business is in France now",
"web_search": true,
"web_search_city": "Paris",
"web_search_country_iso_code": "FR"
}
],
"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><br><strong>Note:</strong> if <code>web_search</code> is set to <code>true</code> or the reasoning model is specified in the request, the output token count may exceed the specified <code>max_output_tokens</code> limit",
"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"
},
"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> object 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.0695,
"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.0695 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.0695
- 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
Note: if web_search is set to true or the reasoning model is specified in the request, the output token count may exceed the specified max_output_tokens limit
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
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 object 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
[
{
"max_output_tokens": 200,
"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",
"temperature": 0.3,
"top_p": 0.5,
"user_prompt": "provide information on how relevant the amusement park business is in France now",
"web_search": true,
"web_search_city": "Paris",
"web_search_country_iso_code": "FR"
}
]
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