跳转到内容
EN

列出会话条目

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

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

OpenAI 官方文档 ↗

请求参数

  • conversation_idstring必填

    path:

  • limitinteger可选
    默认 20

    query: Maximum items per page (values above 100 are clamped).

  • afterstring可选

    query: Item ID from the previous page; returns items after this cursor.

  • orderstring可选
    默认 "desc"

    query: Sort by stored creation order.

    取值 ascdesc

返回

200 list

按创建顺序列出会话的 items,支持 limit/after/order 分页参数。

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

请求示例

curl
# 先调用「创建对话」拿到 conv_ 开头的 ID,替换 conv_123。
curl https://api.deepraxis.com/openai/v1/conversations/conv_123/items \
  -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",
)

items = client.conversations.items.list("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 items = await client.conversations.items.list("conv_123");

响应示例 200

{
  "object": "list",
  "data": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "verify seed item"
        }
      ],
      "id": "item_b264ef5394974e52aec38a2e",
      "status": "completed"
    },
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "round1: reply with the single word pong"
        }
      ],
      "id": "item_e8c0a83be2fa4eb1bdc636c9",
      "status": "completed"
    },
    {
      "type": "reasoning",
      "id": "775bbb36-e0f6-48af-a8cb-87080705f356",
      "status": "completed",
      "content": [
        {
          "type": "reasoning_text",
          "text": "…"
        }
      ],
      "summary": [],
      "encrypted_content": "7112c70a-8308-4cf0-9f7d-9bc93d93b845-0"
    },
    {
      "type": "message",
      "id": "05caf6ac-45d3-4229-ab67-eb971b84ab98",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "annotations": [],
          "logprobs": [],
          "text": "pong"
        }
      ],
      "phase": "final_answer",
      "role": "assistant"
    },
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "round2: reply with the single word pong"
        }
      ],
      "id": "item_172f61bb52c14f068eb3c8df",
      "status": "completed"
    },
    {
      "type": "reasoning",
      "id": "38a5d925-88f0-4ef7-a5e6-ed893b02a6f9",
      "status": "completed",
      "content": [
        {
          "type": "reasoning_text",
          "text": "…"
        }
      ],
      "summary": [],
      "encrypted_content": "3625e17d-6d42-4d2b-8843-6ba49203ff77-0"
    },
    {
      "type": "message",
      "id": "1c28a935-4179-463d-be8c-0eec5ef6c1ac",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "annotations": [],
          "logprobs": [],
          "text": "pong"
        }
      ],
      "phase": "final_answer",
      "role": "assistant"
    }
  ],
  "first_id": "item_b264ef5394974e52aec38a2e",
  "last_id": "1c28a935-4179-463d-be8c-0eec5ef6c1ac",
  "has_more": false
}

响应

HTTP 200

The conversation’s items

application/json

名称 类型 说明
object string Object type; always list.
data array<object> Items of the conversation, in the order the list requested.
first_id string Id of the first item of this page; null for an empty page.
last_id string Id of the last item of this page; null for an empty page.
has_more boolean Whether more items exist beyond this page; pass last_id as after to read them.