DataForSEO AI Optimization Perplexity LLM Responses Live

按实际用量计费
ae_dataforseo_ai_optimization_perplexity_llm_responses_live

通过 DataForSEO 调用 Perplexity 模型生成回答。请按本接口参数要求,将任务放入 request_body 数组。

效率工具
按实际用量计费

价格说明

单次费用为(较大值(1200 × 实际用量总费用(美元), 0))AE积分。各项条件同时适用,按所选条件计算合计费用。

实际用量总费用包含任务基础费用和模型实际使用费用,随所选模型、实际处理的输入量、生成的输出量及联网搜索等功能而变化。Sonar 系列默认启用联网搜索;设置的输出上限不等于实际输出用量。

工具参数

未传入的可选参数将使用平台默认值。

参数类型必填说明默认值
request_bodyarray是暂无参数说明。—
request_body[].tagstring | null否暂无参数说明。—
request_body[].top_pnumber | null否暂无参数说明。—
request_body[].model_namestring否<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 | null否暂无参数说明。—
request_body[].user_promptstring否<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 | null否暂无参数说明。—
request_body[].message_chain[].rolestring | null否暂无参数说明。—
request_body[].message_chain[].messagestring | null否暂无参数说明。—
request_body[].system_messagestring | null否暂无参数说明。—
request_body[].max_output_tokensinteger | null否暂无参数说明。—
request_body[].web_search_country_iso_codestring | null否暂无参数说明。—

调用示例

复制请求代码,查看对应的返回示例。

POST/agent-api/v1/tool/executeX-Api-Key
请求代码request.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.json
JSON部分内容
{
  "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."
}

返回示例仅展示部分内容,不代表完整响应;复制内容为合法 JSON。