Skip to content
Primary navigation

List ChatKit threads

beta.chatkit.threads.list(ThreadListParams**kwargs) -> SyncConversationCursorPage[ChatKitThread]
GET/chatkit/threads

List ChatKit threads with optional pagination and user filters.

ParametersExpand Collapse
after: Optional[str]

List items created after this thread item ID. Defaults to null for the first page.

before: Optional[str]

List items created before this thread item ID. Defaults to null for the newest results.

limit: Optional[int]

Maximum number of thread items to return. Defaults to 20.

minimum0
maximum100
order: Optional[Literal["asc", "desc"]]

Sort order for results by creation time. Defaults to desc.

Accepts one of the following:
"asc"
"desc"
user: Optional[str]

Filter threads that belong to this user identifier. Defaults to null to return all users.

minLength1
maxLength512
ReturnsExpand Collapse
class ChatKitThread: …

Represents a ChatKit thread and its current status.

id: str

Identifier of the thread.

created_at: int

Unix timestamp (in seconds) for when the thread was created.

object: Literal["chatkit.thread"]

Type discriminator that is always chatkit.thread.

status: Status

Current status for the thread. Defaults to active for newly created threads.

Accepts one of the following:
class StatusActive: …

Indicates that a thread is active.

type: Literal["active"]

Status discriminator that is always active.

class StatusLocked: …

Indicates that a thread is locked and cannot accept new input.

reason: Optional[str]

Reason that the thread was locked. Defaults to null when no reason is recorded.

type: Literal["locked"]

Status discriminator that is always locked.

class StatusClosed: …

Indicates that a thread has been closed.

reason: Optional[str]

Reason that the thread was closed. Defaults to null when no reason is recorded.

type: Literal["closed"]

Status discriminator that is always closed.

title: Optional[str]

Optional human-readable title for the thread. Defaults to null when no title has been generated.

user: str

Free-form string that identifies your end user who owns the thread.

List ChatKit threads

from openai import OpenAI

client = OpenAI()
page = client.beta.chatkit.threads.list()
page = page.data[0]
print(page.id)
{
  "data": [
    {
      "id": "cthr_abc123",
      "object": "chatkit.thread",
      "title": "Customer escalation"
    },
    {
      "id": "cthr_def456",
      "object": "chatkit.thread",
      "title": "Demo feedback"
    }
  ],
  "has_more": false,
  "object": "list"
}
Returns Examples
{
  "data": [
    {
      "id": "cthr_abc123",
      "object": "chatkit.thread",
      "title": "Customer escalation"
    },
    {
      "id": "cthr_def456",
      "object": "chatkit.thread",
      "title": "Demo feedback"
    }
  ],
  "has_more": false,
  "object": "list"
}