跳转到内容
EN

读取会话

先调用「创建对话」拿到 conv_ 开头的 ID,替换 conv_123。

GET/openai/v1/conversations/{conversation_id}● 支持

OpenAI 官方文档 ↗

请求参数

  • conversation_idstring必填

    path:

返回

200 conversation

按 ID 读取一个会话。不存在或属于其他租户都返回 404 conversation_not_found。

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

请求示例

curl
# 先调用「创建对话」拿到 conv_ 开头的 ID,替换 conv_123。
curl https://api.deepraxis.com/openai/v1/conversations/conv_123 \
  -H "Authorization: Bearer $PRAXIS_API_KEY"
Python
# 先调用「创建对话」拿到 conv_ 开头的 ID,替换 conv_123。
from openai import OpenAI

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

conversation = client.conversations.retrieve("conv_123")
TypeScript
// 先调用「创建对话」拿到 conv_ 开头的 ID,替换 conv_123。
import OpenAI from "openai";

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

const conversation = await client.conversations.retrieve("conv_123");

响应示例 200

{
  "id": "conv_b667b1f286494a5e8a735d50",
  "object": "conversation",
  "created_at": 1790319260,
  "metadata": {
    "topic": "example"
  }
}

响应

HTTP 200

The conversation

application/json

名称 类型 说明
id string Id of the conversation, such as conv_...; use it as conversation_id in conversation calls and as conversation in createResponse.
object string Object type; always conversation.
created_at integer Unix time in seconds at which the conversation was created.
metadata object Up to 16 string key/value pairs; keys at most 64 characters and values at most 512.