The cost of the task can be calculated on the Pricing page.
Live Claude LLM Responses
Live Claude LLM Responses endpoint allows you to retrieve structured responses from a specific Claude model, based on the input parameters.
Live Claude LLM Responses endpoint allows you to retrieve structured responses from a specific Claude model, based on the input parameters.
The cost of the task can be calculated on the Pricing page.
All POST data should be sent in the JSON format (UTF-8 encoding). The task setting is done using the POST method. When setting a task, you should send all task parameters in the task array of the generic POST array. You can send up to 2000 API calls per minute, each Live Claude LLM Responses call can contain only one task.
The number of concurrent Live tasks is currently limited to 30 per account for each platform in the LLM Responses.
Execution time for tasks set with the Live Claude LLM Responses endpoint is currently up to 120 seconds.
Below you will find a detailed description of the fields you can use for setting a task.
Description of the fields for setting a task:
| Field name | Type | Description |
|---|---|---|
user_prompt | string | prompt for the AI model |
model_name | string | name of the AI model |
max_output_tokens | integer | maximum number of tokens in the AI response |
temperature | float | randomness of the AI response Note: |
top_p | float | diversity of the AI response Note: |
web_search | boolean | enable web search for current information |
force_web_search | boolean | force AI agent to use web search |
web_search_country_iso_code | string | ISO country code of the location |
web_search_city | string | city name of the location |
system_message | string | instructions for the AI behaviour |
message_chain | array | conversation history |
use_reasoning | boolean | enable reasoning for the AI model |
tag | string | user-defined task identifier |
tasks array with the information specific to the set tasks.| Field name | Type | Description |
|---|---|---|
version | string | the current version of the API |
status_code | integer | general status code |
status_message | string | general informational message |
time | string | execution time, seconds |
cost | float | total tasks cost, USD |
tasks_count | integer | the number of tasks in the |
tasks_error | integer | the number of tasks in the |
tasks | array | array of tasks |
id | string | task identifier |
status_code | integer | status code of the task |
status_message | string | informational message of the task |
time | string | execution time, seconds |
cost | float | cost of the task, USD |
result_count | integer | number of elements in the |
path | array | URL path |
data | object | contains the same parameters that you specified in the POST request |
result | array | array of results |
model_name | string | name of the AI model used |
input_tokens | integer | number of tokens in the input |
output_tokens | integer | number of tokens in the output |
reasoning_tokens | integer | number of reasoning tokens |
web_search | boolean | indicates if web search was used |
money_spent | float | cost of AI tokens, USD |
datetime | string | date and time when the result was received |
items | array | array of response items |
reasoning | object | element in the response |
type | string | type of the element = 'reasoning' |
sections | array | reasoning chain sections |
type | string | type of element='summary_text' |
text | string | text of the reasoning chain section |
message | object | element in the response |
type | string | type of the element = 'message' |
sections | array | array of content sections |
type | string | type of element='text' |
text | string | AI-generated text content |
annotations | array | array of references used to generate the response |
title | string | the domain name or title of the quoted source |
url | string | URL of the quoted source |
fan_out_queries | array | array of fan-out queries |
Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-access
# Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-access
login="login"
password="password"
cred="$(printf ${login}:${password} | base64)"
curl --location --request POST "https://api.dataforseo.com/v3/ai_optimization/claude/llm_responses/live"
--header "Authorization: Basic ${cred}"
--header "Content-Type: application/json"
--data-raw '[
{
"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-4-0",
"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"
}
]'<?php
// You can download this file from here https://cdn.dataforseo.com/v3/examples/php/php_RestClient.zip
require('RestClient.php');
$api_url = 'https://api.dataforseo.com/';
try {
// Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-access
$client = new RestClient($api_url, null, 'login', 'password');
} catch (RestClientException $e) {
echo "n";
print "HTTP code: {$e->getHttpCode()}n";
print "Error code: {$e->getCode()}n";
print "Message: {$e->getMessage()}n";
print $e->getTraceAsString();
echo "n";
exit();
}
$post_array = array();
// You can set only one task at a time
$post_array[] = array(
"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-4-0",
"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"
);
if (count($post_array) > 0) {
try {
// POST /v3/serp/google/ai_mode/live/advanced
// in addition to 'google' and 'ai_mode' you can also set other search engine and type parameters
// the full list of possible parameters is available in documentation
$result = $client->post('/v3/ai_optimization/claude/llm_responses/live', $post_array);
print_r($result);
// do something with post result
} catch (RestClientException $e) {
echo "n";
print "HTTP code: {$e->getHttpCode()}n";
print "Error code: {$e->getCode()}n";
print "Message: {$e->getMessage()}n";
print $e->getTraceAsString();
echo "n";
}
$client = null;
?>const axios = require('axios');
axios({
method: 'post',
url: 'https://api.dataforseo.com/v3/ai_optimization/claude/llm_responses/live',
auth: {
username: 'login',
password: 'password'
},
data: [{
system_message: encodeURI("communicate as if we are in a business meeting"),
message_chain: [
{
role: "user",
message: "Hello, what’s up?"
},
{
role: "ai",
message: encodeURI("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-4-0",
temperature: 0.3,
web_search: true,
web_search_country_iso_code: "FR",
user_prompt: encodeURI("provide information on how relevant the amusement park business is in France now")
}],
headers: {
'content-type': 'application/json'
}
}).then(function (response) {
var result = response['data']['tasks'];
// Result data
console.log(result);
}).catch(function (error) {
console.log(error);
});"""
Method: POST
Endpoint: https://api.dataforseo.com/v3/ai_optimization/claude/llm_responses/live
@see https://docs.dataforseo.com/v3/ai_optimization/claude/llm_responses/live
"""
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../../../')))
from lib.client import RestClient
from lib.config import username, password
client = RestClient(username, password)
post_data = []
post_data.append({
'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': 1024,
'temperature': 0.3,
'web_search_country_iso_code': 'FR',
'model_name': 'claude-opus-4-0',
'web_search': True,
'user_prompt': 'provide information on how relevant the amusement park business is in France now'
})
try:
response = client.post('/v3/ai_optimization/claude/llm_responses/live', post_data)
print(response)
# do something with post result
except Exception as e:
print(f'An error occurred: {e}')using System;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace DataForSeoSdk;
public class AiOptimization
{
private static readonly HttpClient _httpClient;
static AiOptimization()
{
_httpClient = new HttpClient
{
BaseAddress = new Uri("https://api.dataforseo.com/")
};
_httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Basic", ApiConfig.Base64Auth);
}
/// <summary>
/// Method: POST
/// Endpoint: https://api.dataforseo.com/v3/ai_optimization/claude/llm_responses/live
/// </summary>
/// <see href="https://docs.dataforseo.com/v3/ai_optimization/claude/llm_responses/live"/>
public static async Task ClaudeLlmResponsesLive()
{
var postData = new List<object>();
// a simple way to set a task, the full list of possible parameters is available in documentation
postData.Add(new
{
system_message = "communicate as if we are in a business meeting",
message_chain = new object[]
{
new
{
role = "user",
message = "Hello, what's up?"
},
new
{
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 = 1024,
temperature = 0.3,
web_search_country_iso_code = "FR",
model_name = "claude-opus-4-0",
web_search = true,
user_prompt = "provide information on how relevant the amusement park business is in France now"
});
var content = new StringContent(JsonConvert.SerializeObject(postData), Encoding.UTF8, "application/json");
using var response = await _httpClient.PostAsync("/v3/ai_optimization/claude/llm_responses/live", content);
var result = JsonConvert.DeserializeObject<dynamic>(await response.Content.ReadAsStringAsync());
// you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
if (result.status_code == 20000)
{
// do something with result
Console.WriteLine(result);
}
else
Console.WriteLine($"error. Code: {result.status_code} Message: {result.status_message}");
}The above command returns JSON structured like this:
{
"version": "0.1.20251208",
"status_code": 20000,
"status_message": "Ok.",
"time": "30.3333 sec.",
"cost": 0.55051,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "12111428-1535-0612-0000-dca69722c6fd",
"status_code": 20000,
"status_message": "Ok.",
"time": "30.2569 sec.",
"cost": 0.55051,
"result_count": 1,
"path": [
"v3",
"ai_optimization",
"claude",
"llm_responses",
"live"
],
"data": {
"api": "ai_optimization",
"function": "llm_responses",
"se": "claude",
"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?"
}
],
"temperature": 0.3,
"web_search_country_iso_code": "FR",
"model_name": "claude-opus-4-0",
"web_search": true,
"user_prompt": "provide information on how relevant the amusement park business is in France now"
},
"result": [
{
"model_name": "claude-opus-4-20250514",
"input_tokens": 31304,
"output_tokens": 938,
"reasoning_tokens": 576,
"web_search": true,
"money_spent": 0.54991,
"datetime": "2025-12-11 14:29:13 +00:00",
"items": [
{
"type": "reasoning",
"sections": [
{
"type": "summary_text",
"text": "**Exploring a riddle**nnThis likely refers to a riddle or joke. The classic answer seems to be a cup that's closed at the top and bottom, making it essentially useless. Or, is it a trophy cup or even a cupcake? I need to think through this riddle: I have a cup with no bottom and a closed top. How can I drink from it? The punchline might simply be that you can't drink from it. Hm, I wonder if there might be other interpretations too!"
},
{
"type": "summary_text",
"text": "**Pondering a riddle’s meaning**nnI’m considering if this cup could also mean something like hiccup — closed at the top and bottom? But if there’s no bottom, anything liquid just falls out. A closed top means you can’t pour anything in. So it may not be a traditional drinking cup. Maybe it’s an acorn cup, although it has an open top. The joke could suggest inverting it, but that still leaves it open. I’m not sure how it all ties back to drinking from it!"
},
{
"type": "summary_text",
"text": "**Clarifying the riddle’s punchline**nnSo, the answer seems to be that you're meant to drink from the rim, but since there’s no bottom and the top is closed, it's impossible to do that. The correct response points to a thimble instead, which has an open bottom. The punchline is clear: You can't drink; it's a thimble. The riddle plays on the expectation of a witty response. To keep it light, I could say, You don't! That's a thimble! and add a playful tone."
}
]
},
{
"type": "message",
"sections": [
{
"type": "text",
"text": "I'll search for current information about the amusement park business in France.",
"annotations": null
}
]
},
{
"type": "message",
"sections": [
{
"type": "text",
"text": "Let me search for more specific information about the French amusement park market's current performance and trends.",
"annotations": null
}
]
},
{
"type": "message",
"sections": [
{
"type": "text",
"text": "Based on my research, I can provide you with comprehensive information about the current relevance of the amusement park business in France:nn## Current State of the French Amusement Park IndustrynnThe amusement park business remains highly relevant and robust in France. Here are the key findings:nn### Market Size and Performancenn",
"annotations": null
},
{
"type": "text",
"text": "France's amusement park industry generates approximately €4 billion in annual revenue and welcomes over 70 million visitors each year",
"annotations": [
{
"title": "Le marché des parcs de loisirs : étude, tendances, classements",
"url": "https://www.xerfi.com/presentationetude/le-marche-des-parcs-de-loisirs_SME12"
},
{
"title": "Le marché des parcs de loisirs : étude, tendances, classements",
"url": "https://www.xerfi.com/presentationetude/le-marche-des-parcs-de-loisirs_SME12"
}
]
},
{
"type": "text",
"text": ". ",
"annotations": null
},
{
"type": "text",
"text": "The country has approximately 650 leisure parks distributed across its territory",
"annotations": [
{
"title": "Le marché des parcs de loisirs : étude, tendances, classements",
"url": "https://www.xerfi.com/presentationetude/le-marche-des-parcs-de-loisirs_SME12"
}
]
},
{
"type": "text",
"text": ".nn",
"annotations": null
},
{
"type": "text",
"text": "The recreational activities sector in France, which includes amusement parks, is projected to grow from €29.5 billion in 2023 to €34.3 billion by 2028",
"annotations": [
{
"title": "France Recreational Activity Industry Outlook 2024 - 2028",
"url": "https://www.reportlinker.com/clp/country/508831/726362"
},
{
"title": "France Recreational Activity Industry Outlook 2024 - 2028",
"url": "https://www.reportlinker.com/clp/country/508831/726362"
}
]
},
{
"type": "text",
"text": ", representing ",
"annotations": null
},
{
"type": "text",
"text": "a compound annual growth rate (CAGR) of 2.4%",
"annotations": [
{
"title": "France Recreational Activity Industry Outlook 2024 - 2028",
"url": "https://www.reportlinker.com/clp/country/508831/726362"
}
]
},
{
"type": "text",
"text": ".nn### Key Players and RankingsnnThe French market is dominated by several major operators:nn1. **Disneyland Paris** - ",
"annotations": null
},
{
"type": "text",
"text": "Attracts 15 million annual visitors and generates €6.2 billion in economic impact",
"annotations": [
{
"title": "Amusement Parks Market Size, Share & Growth Report [2024-2034]",
"url": "https://www.emergenresearch.com/industry-report/amusement-parks-market"
}
]
},
{
"type": "text",
"text": "n2. **Parc Astérix** - One of the top three parks in Francen3. **Puy du Fou** - ",
"annotations": null
},
{
"type": "text",
"text": "The third most visited theme park in France with 2.8 million annual visitors in 2024",
"annotations": [
{
"title": "Le Puy du Fou - Wikipedia",
"url": "https://en.wikipedia.org/wiki/Le_Puy_du_Fou"
},
{
"title": "Le Puy du Fou - Wikipedia",
"url": "https://en.wikipedia.org/wiki/Le_Puy_du_Fou"
}
]
},
{
"type": "text",
"text": "nn### Industry Structurenn",
"annotations": null
},
{
"type": "text",
"text": "While the majority of establishments are small, often family-managed with local roots, the bulk of attendance is concentrated in about fifteen major parks with national or international reach",
"annotations": [
{
"title": "Le marché des parcs de loisirs : étude, tendances, classements",
"url": "https://www.xerfi.com/presentationetude/le-marche-des-parcs-de-loisirs_SME12"
}
]
},
{
"type": "text",
"text": ".nn### European Contextnn",
"annotations": null
},
{
"type": "text",
"text": "France and the United Kingdom represent mature markets",
"annotations": [
{
"title": "Europe Amusement Parks Market Size & Share Analysis - Industry Research Report - Growth Trends",
"url": "https://www.mordorintelligence.com/industry-reports/europe-amusement-parks-market"
},
{
"title": "Europe Amusement Parks Market Size & Share Analysis - Industry Research Report - Growth Trends",
"url": "https://www.mordorintelligence.com/industry-reports/europe-amusement-parks-market"
}
]
},
{
"type": "text",
"text": " within Europe. ",
"annotations": null
},
{
"type": "text",
"text": "Europe accounts for 28.5% of the global amusement parks market in 2024",
"annotations": [
{
"title": "Amusement Parks Market Size, Share & Growth Report [2024-2034]",
"url": "https://www.emergenresearch.com/industry-report/amusement-parks-market"
}
]
},
{
"type": "text",
"text": ", with ",
"annotations": null
},
{
"type": "text",
"text": "the European amusement park market expected to reach USD 27.09 billion in 2025",
"annotations": [
{
"title": "Europe Amusement Parks Market Size & Share Analysis - Industry Research Report - Growth Trends",
"url": "https://www.mordorintelligence.com/industry-reports/europe-amusement-parks-market"
}
]
},
{
"type": "text",
"text": ".nn### Industry Strengthsnn1. **Government Support**: ",
"annotations": null
},
{
"type": "text",
"text": "France's theme park sector benefits from government tourism promotion efforts",
"annotations": [
{
"title": "Amusement Parks Market Size, Share & Growth Report [2024-2034]",
"url": "https://www.emergenresearch.com/industry-report/amusement-parks-market"
}
]
},
{
"type": "text",
"text": "n2. **Employment**: ",
"annotations": null
},
{
"type": "text",
"text": "The industry employs more than 50,000 people",
"annotations": [
{
"title": "No. 1 amusement park in France | Puy du Fou",
"url": "https://www.puydufou.com/france/en/no-1-amusement-park-france"
},
{
"title": "No. 1 amusement park in France | Puy du Fou",
"url": "https://www.puydufou.com/france/en/no-1-amusement-park-france"
}
]
},
{
"type": "text",
"text": "n3. **Innovation**: Parks continue to invest heavily in new attractions and experiencesn4. **International Recognition**: ",
"annotations": null
},
{
"type": "text",
"text": "Puy du Fou has won 9 international awards in just 7 years",
"annotations": [
{
"title": "No. 1 amusement park in France | Puy du Fou",
"url": "https://www.puydufou.com/france/en/no-1-amusement-park-france"
}
]
},
{
"type": "text",
"text": "nn### Current Trendsnn- Focus on experiential entertainment and immersive experiencesn- Development of on-site accommodations to transform parks into multi-day destinationsn- Integration of new technologiesn- Emphasis on themed experiences and storytellingnnThe French amusement park industry demonstrates strong resilience and continued growth potential, making it a highly relevant business sector in the country's economy and tourism landscape.",
"annotations": null
}
]
}
],
"fan_out_queries": [
"France amusement park industry 2024",
"France theme park attendance 2024 recovery"
]
}
]
}
]
}