Skip to content

Perplexity LLM 响应模型列表

GET /v3/ai_optimization/perplexity/llm_responses/models

本接口使用 GET 方法,路径为:

/v3/ai_optimization/perplexity/llm_responses/models

用于获取当前可用的 Perplexity AI 模型列表,以及每个模型支持的推理、联网搜索和标准任务提交能力。

计费说明

本接口当前调用,不收取接口费用。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求

请求方法

GET

请求地址

text
https://api.seermartech.cn/v3/ai_optimization/perplexity/llm_responses/models

请求头

http
Authorization: Bearer smt_live_YOUR_KEY
Content-Type: application/json

本接口无需请求体。

响应结构

接口返回 JSON 数据 tasks 数组本次请求的任务结果。

顶层字段

字段类型说明
versionstring当前 API 版本
status_codeinteger请求级状态码
status_messagestring请求级状态说明
timestring请求执行耗时,单位为秒
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks_countintegertasks 数组中的任务数量
tasks_errorintegertasks 数组中返回错误的任务数量
tasksarray任务结果数组

tasks 字段

字段类型说明
idstring任务唯一标识,采用 UUID 格式
status_codeinteger任务状态码,取值范围为 1000060000
status_messagestring任务状态说明
timestring任务执行耗时,单位为秒
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
result_countintegerresult 数组中的数量
patharray当前请求的 URL 路径
dataobject当前 GET 请求中使用的参数信息
resultarray模型列表结果

完整状态码和错误说明请参考 /v3/appendix/errors

result 模型字段

字段类型说明
model_namestringAI 模型名称
reasoningboolean是否支持推理能力
web_search_supportedboolean是否支持联网搜索;为 true 时,可在后续请求中为该模型设置 web_search 参数
task_post_supportedboolean是否支持标准 POST-GET 数据获取方式;为 true 时,可使用标准任务提交与查询流程

请求示例

cURL

bash
curl --location --request GET \
  "https://api.seermartech.cn/v3/ai_optimization/perplexity/llm_responses/models" \
  --header "Authorization: Bearer smt_live_YOUR_KEY" \
  --header "Content-Type: application/json"

Python

python
import requests

url = "https://api.seermartech.cn/v3/ai_optimization/perplexity/llm_responses/models"

headers = {
    "Authorization": "Bearer smt_live_YOUR_KEY",
    "Content-Type": "application/json",
}

response = requests.get(url, headers=headers)
response.raise_for_status()

result = response.json()

if result.get("status_code") == 20000:
    print(result)
else:
    print(
        f"请求失败,状态码:{result.get('status_code')},"
        f"说明:{result.get('status_message')}"
    )

TypeScript

typescript
import axios from "axios";

axios
  .get(
    "https://api.seermartech.cn/v3/ai_optimization/perplexity/llm_responses/models",
    {
      headers: {
        Authorization: "Bearer smt_live_YOUR_KEY",
        "Content-Type": "application/json",
      },
    }
  )
  .then((response) => {
    const result = response.data;

    if (result.status_code === 20000) {
      console.log("模型列表:", result);
    } else {
      console.error(
        `请求失败,状态码:${result.status_code},说明:${result.status_message}`
      );
    }
  })
  .catch((error) => {
    console.error("请求异常:", error.message);
  });

响应示例

json
{
  "version": "0.1.20260116",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.0483 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "8f2e7b7d-2c7f-4f02-a8b1-3f0e9c1d6a10",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.0421 sec.",
      "cost": 0,
      "result_count": 1,
      "path": [
        "v3",
        "ai_optimization",
        "perplexity",
        "llm_responses",
        "models"
      ],
      "data": {
        "api": "ai_optimization",
        "function": "llm_responses",
        "se": "perplexity"
      },
      "result": [
        {
          "model_name": "sonar",
          "reasoning": false,
          "web_search_supported": true,
          "task_post_supported": true
        }
      ]
    }
  ]
}

状态码处理

当顶层 status_code 或任务级 status_code20000 时,表示请求成功。状态码表示请求或任务处理异常,应结合对应的 status_message 进行排查。

实用场景

  • 获取可用模型单:在 SEO生成、问答分析平台中动态展示当前可调用模型,使用已下线或不支持的模型。
  • 筛选联网搜索模型:根据 web_search_supported 自动筛选支持实时搜索的模型,用于品牌监测和搜索结果问答分析。
  • 选择推理模型:根据 reasoning 字段选择备推理能力的模型,用于复杂意图分类、竞品拆解和 SEO 策略判断。
  • 判断任务提交方式:利用 task_post_supported 判断模型是否支持标准 POST-GET 流程,从而为批量 AI 查询任务选择合适的调用模式。
  • 构建模型能力:定期同步模型名称及能力标签,为不同 SEO 业务流程模型路由和降级策略。

统一入口:官网 · LLM API · 控制台