跳转到内容
EN

读取响应

先调用「生成响应」,用返回的 ID 替换 resp_123。

GET/openai/v1/responses/{response_id}● 支持

OpenAI 官方文档 ↗

请求参数

  • response_idstring必填

    path:

返回

200 response

按 ID 读取一条已保存的响应。如果创建时 store 为 false,我们不会保存这次响应,读取会返回 404 response_not_found;超过保留期(默认 30 天)后读取也会返回同样的 404。

错误按 OpenAI 格式返回,参见 错误码

请求示例

curl
# 先调用「生成响应」,用返回的 ID 替换 resp_123。
curl https://api.deepraxis.com/openai/v1/responses/resp_123 \
  -H "Authorization: Bearer $PRAXIS_API_KEY"
Python
# 先调用「生成响应」,用返回的 ID 替换 resp_123。
from openai import OpenAI

client = OpenAI(
    base_url="https://api.deepraxis.com/openai/v1",
    api_key="$PRAXIS_API_KEY",
)

resp = client.responses.retrieve("resp_123")
TypeScript
// 先调用「生成响应」,用返回的 ID 替换 resp_123。
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.deepraxis.com/openai/v1",
  apiKey: "$PRAXIS_API_KEY",
});

const resp = await client.responses.retrieve("resp_123");

响应示例 200

{
  "id": "4d800a0d-a91a-4ba8-ac50-7a599f246c7a",
  "object": "response",
  "created_at": 1790319256,
  "status": "completed",
  "background": false,
  "completed_at": 1790319256,
  "content_filters": null,
  "error": null,
  "frequency_penalty": 0,
  "incomplete_details": null,
  "instructions": null,
  "max_output_tokens": null,
  "max_tool_calls": null,
  "model": "deepseek-flash",
  "moderation": null,
  "output": [
    {
      "type": "reasoning",
      "id": "ebc9051f-c8b4-4fc4-a926-50655694ed04",
      "status": "completed",
      "content": [
        {
          "type": "reasoning_text",
          "text": "The user simply said \"你好\" (Hello) in Chinese. I should respond warmly in Chinese, introduce myself briefly, and offer help."
        }
      ],
      "summary": [],
      "encrypted_content": "4d800a0d-a91a-4ba8-ac50-7a599f246c7a-0"
    },
    {
      "type": "message",
      "id": "6204bd5e-5cc3-4a72-a160-45851e587add",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "annotations": [],
          "logprobs": [],
          "text": "你好!很高兴见到你 😊\n\n我是 DeepSeek,一个乐于帮忙的 AI 助手。有什么我可以帮你的吗?无论是聊天、解答问题、写东西、翻译,还是分析文件,都可以告诉我~"
        }
      ],
      "phase": "final_answer",
      "role": "assistant"
    }
  ],
  "parallel_tool_calls": true,
  "presence_penalty": 0,
  "previous_response_id": null,
  "prompt_cache_key": null,
  "prompt_cache_retention": null,
  "reasoning": {
    "effort": null,
    "summary": null
  },
  "safety_identifier": null,
  "service_tier": "default",
  "store": true,
  "temperature": 1,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": null
  },
  "tool_choice": "auto",
  "tools": [],
  "top_logprobs": 0,
  "top_p": 1,
  "truncation": "disabled",
  "usage": {
    "input_tokens": 31,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 74,
    "output_tokens_details": {
      "reasoning_tokens": 28
    },
    "total_tokens": 105
  },
  "user": null,
  "metadata": {}
}

响应

HTTP 200

Native Responses API response

application/json

名称 类型 说明
$ object