# Fixed reference example. Playground inputs do not update this sample.
curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/ai_optimization/claude/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,
"model_name": "claude-opus-5",
"temperature": 0.3,
"web_search": true,
"web_search_country_iso_code": "FR",
"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/claude/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": "claude-opus-5",
"system_message": "communicate as if we are in a business meeting",
"temperature": 0.3,
"user_prompt": "provide information on how relevant the amusement park business is in France now",
"web_search": true,
"web_search_country_iso_code": "FR"
}
]
'import requests
url = "https://api.aisa.one/apis/v1/dataforseo/ai_optimization/claude/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": "claude-opus-5",
"system_message": "communicate as if we are in a business meeting",
"temperature": 0.3,
"user_prompt": "provide information on how relevant the amusement park business is in France now",
"web_search": True,
"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: 'claude-opus-5',
system_message: 'communicate as if we are in a business meeting',
temperature: 0.3,
user_prompt: 'provide information on how relevant the amusement park business is in France now',
web_search: true,
web_search_country_iso_code: 'FR'
}
])
};
fetch('https://api.aisa.one/apis/v1/dataforseo/ai_optimization/claude/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/claude/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' => 'claude-opus-5',
'system_message' => 'communicate as if we are in a business meeting',
'temperature' => 0.3,
'user_prompt' => 'provide information on how relevant the amusement park business is in France now',
'web_search' => true,
'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/claude/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\": \"claude-opus-5\",\n \"system_message\": \"communicate as if we are in a business meeting\",\n \"temperature\": 0.3,\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\",\n \"web_search\": true,\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/claude/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\": \"claude-opus-5\",\n \"system_message\": \"communicate as if we are in a business meeting\",\n \"temperature\": 0.3,\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\",\n \"web_search\": true,\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/claude/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\": \"claude-opus-5\",\n \"system_message\": \"communicate as if we are in a business meeting\",\n \"temperature\": 0.3,\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\",\n \"web_search\": true,\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
}
]
}
]
}Claude LLM 实时响应
把 user_prompt 发给某个 Claude 模型并同步返回回复。
# Fixed reference example. Playground inputs do not update this sample.
curl --request POST \
--url https://api.aisa.one/apis/v1/dataforseo/ai_optimization/claude/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,
"model_name": "claude-opus-5",
"temperature": 0.3,
"web_search": true,
"web_search_country_iso_code": "FR",
"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/claude/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": "claude-opus-5",
"system_message": "communicate as if we are in a business meeting",
"temperature": 0.3,
"user_prompt": "provide information on how relevant the amusement park business is in France now",
"web_search": true,
"web_search_country_iso_code": "FR"
}
]
'import requests
url = "https://api.aisa.one/apis/v1/dataforseo/ai_optimization/claude/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": "claude-opus-5",
"system_message": "communicate as if we are in a business meeting",
"temperature": 0.3,
"user_prompt": "provide information on how relevant the amusement park business is in France now",
"web_search": True,
"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: 'claude-opus-5',
system_message: 'communicate as if we are in a business meeting',
temperature: 0.3,
user_prompt: 'provide information on how relevant the amusement park business is in France now',
web_search: true,
web_search_country_iso_code: 'FR'
}
])
};
fetch('https://api.aisa.one/apis/v1/dataforseo/ai_optimization/claude/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/claude/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' => 'claude-opus-5',
'system_message' => 'communicate as if we are in a business meeting',
'temperature' => 0.3,
'user_prompt' => 'provide information on how relevant the amusement park business is in France now',
'web_search' => true,
'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/claude/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\": \"claude-opus-5\",\n \"system_message\": \"communicate as if we are in a business meeting\",\n \"temperature\": 0.3,\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\",\n \"web_search\": true,\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/claude/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\": \"claude-opus-5\",\n \"system_message\": \"communicate as if we are in a business meeting\",\n \"temperature\": 0.3,\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\",\n \"web_search\": true,\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/claude/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\": \"claude-opus-5\",\n \"system_message\": \"communicate as if we are in a business meeting\",\n \"temperature\": 0.3,\n \"user_prompt\": \"provide information on how relevant the amusement park business is in France now\",\n \"web_search\": true,\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 发给某个 Claude 模型并同步返回回复。model_name 必须来自 get_dataforseo_ai_claude_llm_responses_models——名字形如 claude-sonnet-5,看起来合理的猜测会被拒。返回 model_name、input_tokens、output_tokens、reasoning_tokens、web_search、money_spent、datetime、items 和 fan_out_queries。💰 按次固定计费,与回复长度无关。看响应里的 money_spent 才知道一个 prompt 实际花了多少。 响应包在信封里:数据在 tasks[0].result,成败在 tasks[0].status_code——请求被拒时 HTTP 仍是 200。
示例
curl -X POST "https://api.aisa.one/apis/v1/dataforseo/ai_optimization/claude/llm_responses/live" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '[{"user_prompt": "...", "model_name": "...", "max_output_tokens": "..."}]'
// 把整段复制给 Claude Code、Codex、Cursor 或任意 coding agent。
// 连接、授权、跑通这个例子需要的东西都在里面 ——
// 不用粘贴任何 key,浏览器里点一次 Allow 就好。
{
"calls": [
{
"call_id": "1",
"tool": "post_dataforseo_ai_claude_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/zh/api-reference/dataforseo/post_dataforseo-ai-optimization-claude-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 都可以。鉴权走 OAuth:客户端打开浏览器,你点一次
Allow,不需要粘贴任何 key。之后智能体通过几个元工具调用所有端点:
search、list_categories、get_details 和 batch_quote 免费,batch_use
按次计费。各客户端的接入步骤见通过 MCP 连接;实时工具列表和
每次调用的价格见 aisa.one/zh-cn/mcp。请求规范
- 方法与路径: POST /apis/v1/dataforseo/ai_optimization/claude/llm_responses/live
- 可用状态: enabled
- 请求 URL 模板: https://api.aisa.one/apis/v1/dataforseo/ai_optimization/claude/llm_responses/live
- Runtime 事实版本: 6ab8fec17df1d5dcdff2e036dd1eb40587752b774ec040ab4eb0cc6946c3dd3c
{
"operationId": "post_dataforseo_ai_claude_llm_responses_live",
"method": "POST",
"path": "/apis/v1/dataforseo/ai_optimization/claude/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": "claude-opus-5",
"system_message": "communicate as if we are in a business meeting",
"temperature": 0.3,
"user_prompt": "provide information on how relevant the amusement park business is in France now",
"web_search": true,
"web_search_country_iso_code": "FR"
}
],
"items": {
"oneOf": [
{
"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",
"type": [
"boolean",
"null"
]
},
"max_output_tokens": {
"description": "<em>maximum number of tokens in the AI response</em><br>optional field<br>minimum value: <code>1</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<br><strong>Note #2:</strong> if <code>use_reasoning</code> is set to <code>true</code>, the minimum value for <code>max_output_tokens</code> is <code>1025</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>claude-opus-4-0</code> is specified, the <code>claude-opus-4-20250514</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/claude/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>1</code><br>default value: <code>0.7</code><p><strong>Note:</strong> <code>temperature</code> cannot be used together with <code>top_p</code> in the same request",
"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>null</code><p><strong>Note:</strong> <code>top_p</code> cannot be used together with <code>temperature</code> in the same request",
"type": [
"number",
"null"
]
},
"use_reasoning": {
"description": "<em>enable reasoning for the AI model</em><br>optional field<br>when enabled, the model will perform reasoning before generating a response<br>refer to the <a href=\"https://docs.dataforseo.com/v3/ai_optimization/claude/llm_responses/models/\" target=\"_blank\">Models endpoint</a> for a list of models that support <code>reasoning</code><br>default value: <code>false</code><br><strong>Note:</strong> if set to <code>true</code>, the minimum value for <code>max_output_tokens</code> is <code>1025</code><br><strong>Note #2:</strong> if set to <code>true</code>, <code>force_web_search</code> must be set to <code>false</code><br><strong>Note #3:</strong> if set to <code>true</code>, the <code>temperature</code> and <code>top_p</code> cannot be used",
"type": [
"boolean",
"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 for current information</em><br>optional field<br>when enabled, the AI model can access and cite current web information;<br><strong>Note:</strong> refer to the <a href=\"https://docs.dataforseo.com/v3/ai_optimization/claude/llm_responses/models/\">Models endpoint</a> for a list of models that support <code>web_search</code>; <br>default value: <code>false</code>;<br>The cost of the parameter can be calculated on the <a title=\"Anthropic API Pricing\" href=\"https://docs.anthropic.com/en/docs/about-claude/pricing\" target=\"_blank\" rel=\"noopener noreferrer\">Pricing</a> page",
"type": [
"boolean",
"null"
]
},
"web_search_city": {
"description": "<em>city name of the location used for searching the web</em><br>optional field<br>",
"type": [
"string",
"null"
]
},
"web_search_country_iso_code": {
"description": "<em>ISO country code of the location used for searching the web</em><br>optional field<br>possible values: <code>'AR','AT','AU','BE','BR','CA','CH','CL','CN','DE','DK','ES','FI','FR','GB','HK','ID','IN','IT','JP','KR','MX','MY','NL','NO','NZ','PH','PL','PT','RU','SA','SE','TR','TW','US','ZA'</code>",
"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.0567,
"estimate_source": "profile_seed",
"evidence_source": "response_body"
},
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
按用量计费;默认请求预估费用:$0.0567 USD(不是固定价格)。 最终费用以账户适用价格及实际结算为准。 公开参考值不是你的账户报价或最终扣费。对于支持 X-AISA-Cost-Mode: quote 的接口,执行前请针对完整请求获取免费报价;执行后通过响应费用元数据和 Usage Logs 核对结算费用。1 USD 等于 1,000,000 个整数 micro-USD。- 默认请求参考估价(USD): 0.0567
- 计费依据: response_usd
- 公开参考倍率: 1.0
- 结算证据来源: response_body
授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
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
maximum number of tokens in the AI response
optional field
minimum value: 1;
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
Note #2: if use_reasoning is set to true, the minimum value for max_output_tokens is 1025
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 claude-opus-4-0 is specified, the claude-opus-4-20250514 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/claude/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: 1
default value: 0.7
Note: temperature cannot be used together with top_p in the same request
diversity of the AI response
optional field
controls diversity of the response by limiting token selection;
minimum value: 0
maximum value: 1
default value: null
Note: top_p cannot be used together with temperature in the same request
enable reasoning for the AI model
optional field
when enabled, the model will perform reasoning before generating a response
refer to the Models endpoint for a list of models that support reasoning
default value: false
Note: if set to true, the minimum value for max_output_tokens is 1025
Note #2: if set to true, force_web_search must be set to false
Note #3: if set to true, the temperature and top_p cannot be used
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 for current information
optional field
when enabled, the AI model can access and cite current web information;
Note: refer to the Models endpoint for a list of models that support web_search;
default value: false;
The cost of the parameter can be calculated on the Pricing page
city name of the location used for searching the web
optional field
ISO country code of the location used for searching the web
optional field
possible values: 'AR','AT','AU','BE','BR','CA','CH','CL','CN','DE','DK','ES','FI','FR','GB','HK','ID','IN','IT','JP','KR','MX','MY','NL','NO','NZ','PH','PL','PT','RU','SA','SE','TR','TW','US','ZA'
[
{
"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": "claude-opus-5",
"system_message": "communicate as if we are in a business meeting",
"temperature": 0.3,
"user_prompt": "provide information on how relevant the amusement park business is in France now",
"web_search": true,
"web_search_country_iso_code": "FR"
}
]
响应
Successful operation
任务总成本(美元)
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
tasks 数组中的任务数量
返回错误的 tasks 数组中的任务数量
total execution time, seconds
API 的当前版本
array of tasks
Show child attributes
Show child attributes