DataForSEO AI Optimization Perplexity LLM Responses Live

Usage-based pricing
ae_dataforseo_ai_optimization_perplexity_llm_responses_live

Generate a response from a Perplexity model through DataForSEO. Provide the task parameters in the request_body array according to this interface schema.

Productivity
Usage-based pricing

Pricing

The charge per call is (max(1200 × Total usage charge (USD), 0)) AE credits. All applicable conditions are combined to calculate the total.

The total usage charge includes the base task fee and actual model usage charges. It varies with the selected model, the input actually processed, the output generated, and features such as web search. Sonar models enable web search by default; the configured output limit is not the actual output usage.

Parameters

Optional parameters use the platform defaults when omitted.

ParameterTypeRequiredDescriptionDefault
request_bodyarrayYesNo parameter description.—
request_body[].tagstring | nullNoNo parameter description.—
request_body[].top_pnumber | nullNoNo parameter description.—
request_body[].model_namestringNo<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>you can receive the list of available LLM models by making a separate request to the following endpoint: <code>https://api.dataforseo.com/v3/ai_optimization/perplexity/llm_responses/models</code>—
request_body[].temperaturenumber | nullNoNo parameter description.—
request_body[].user_promptstringNo<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—
request_body[].message_chainarray | nullNoNo parameter description.—
request_body[].message_chain[].rolestring | nullNoNo parameter description.—
request_body[].message_chain[].messagestring | nullNoNo parameter description.—
request_body[].system_messagestring | nullNoNo parameter description.—
request_body[].max_output_tokensinteger | nullNoNo parameter description.—
request_body[].web_search_country_iso_codestring | nullNoNo parameter description.—

Invocation example

Copy the request and explore its response example.

POST/agent-api/v1/tool/executeX-Api-Key
Request coderequest.sh
curl --request POST \
  --url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_dataforseo_ai_optimization_perplexity_llm_responses_live' \
  --header "X-Api-Key: $AGENTEARTH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "params": {
    "request_body": [
      {
        "max_output_tokens": 1500,
        "model_name": "sonar",
        "system_message": "你是一位严谨的科技行业研究分析师,回答需基于事实、条理清晰。",
        "user_prompt": "请研究并总结:2026 年 AI Agent(智能体)技术的最新发展趋势、代表性产品和主要应用场景。要求:1) 分点阐述关键趋势;2) 指出当前的主要局限与挑战。请用中文简洁回答。",
        "web_search_country_iso_code": "CN"
      }
    ]
  }
}'
Response exampleresponse.json
JSONPartial content
{
  "status_code": 20000,
  "status_message": "Ok.",
  "tasks": [
    {
      "data": {
        "api": "ai_optimization",
        "function": "llm_responses",
        "max_output_tokens": 1500,
        "model_name": "sonar",
        "se": "perplexity",
        "system_message": "你是一位严谨的科技行业研究分析师,回答需基于事实、条理清晰。"
      },
      "id": "11171255-2802-0612-0000-a6b2e0052d42",
      "path": [
        "v3"
      ],
      "result": [
        {
          "datetime": "2026-11-17 12:55:21 +00:00",
          "model_name": "sonar",
          "web_search": true
        }
      ],
      "result_count": 1,
      "status_code": 20000
    }
  ],
  "tasks_count": 1,
  "tasks_error": 0,
  "time": "8.6412 sec."
}

This example shows part of the response. Copied content is valid JSON.