Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation
Theme

List ChatKit threads

beta.chatkit.threads.list(**kwargs) -> ConversationCursorPage<ChatKitThread { id, created_at, object, 3 more } >
GET
/chatkit/threads

List ChatKit threads with optional pagination and user filters.

List ChatKit threads

require "openai"

openai = OpenAI::Client.new

page = openai.beta.chatkit.threads.list

puts(page)
Response example
{
  "data": [
    {
      "id": "cthr_abc123",
      "object": "chatkit.thread",
      "title": "Customer escalation",
      "created_at": 1712345600,
      "status": {
        "type": "active"
      },
      "user": "user_123"
    },
    {
      "id": "cthr_def456",
      "object": "chatkit.thread",
      "title": "Demo feedback",
      "created_at": 1712345600,
      "status": {
        "type": "active"
      },
      "user": "user_456"
    }
  ],
  "has_more": false,
  "object": "list",
  "first_id": "cthr_abc123",
  "last_id": "cthr_def456"
}
Parameters
after: String

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

before: String

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

limit: Integer

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

minimum0
maximum100
order: :asc | :desc

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

user: String

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

minLength1
maxLength512
Returns
class ChatKitThread { id, created_at, object, 3 more }

Represents a ChatKit thread and its current status.

id: String

Identifier of the thread.

created_at: Integer

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

formatunixtime
object: :"chatkit.thread"

Type discriminator that is always chatkit.thread.

status: Active{ type} | Locked{ reason, type} | Closed{ reason, type}

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

title: String

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

user: String

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

Returns Examples
Response example
{
  "data": [
    {
      "id": "cthr_abc123",
      "object": "chatkit.thread",
      "title": "Customer escalation",
      "created_at": 1712345600,
      "status": {
        "type": "active"
      },
      "user": "user_123"
    },
    {
      "id": "cthr_def456",
      "object": "chatkit.thread",
      "title": "Demo feedback",
      "created_at": 1712345600,
      "status": {
        "type": "active"
      },
      "user": "user_456"
    }
  ],
  "has_more": false,
  "object": "list",
  "first_id": "cthr_abc123",
  "last_id": "cthr_def456"
}