Skip to main content
Conversations

Retrieve conversation

Retrieve a conversation by its ID.

GET
/conversations/{conversation_id}
Python
import os
from openai import OpenAI

client = OpenAI(
  api_key=os.getenv("DASHSCOPE_API_KEY"),
  base_url="https://dashscope-intl.aliyuncs.com/api/v2/apps/protocols/compatible-mode/v1",
)

conversation = client.conversations.retrieve("conv_xxx")
print(conversation)
{
  "created_at": 1771316949128,
  "id": "conv_xxx",
  "metadata": {
    "topic": "demo"
  },
  "object": "conversation"
}

Authorizations

string
header
required

Qwen Cloud API Key. Create one in the console.

Path Parameters

string
required

The conversation ID.

conv_xxx

Response

200-application/json
integer

Unix timestamp (milliseconds) when the conversation was created.

1771316949128
string

The conversation ID.

conv_xxx
object

Metadata key-value pairs. Up to 16 pairs (keys: max 64 chars, values: max 512 chars).

enum<string>

Always conversation.

conversation