Skip to content
Primary navigation

List ChatKit threads

ThreadListPage beta().chatkit().threads().list(ThreadListParamsparams = ThreadListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/chatkit/threads

List ChatKit threads with optional pagination and user filters.

ParametersExpand Collapse
ThreadListParams params
Optional<String> after

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

Optional<String> before

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

Optional<Long> limit

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

minimum0
maximum100
Optional<Order> order

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

ASC("asc")
DESC("desc")
Optional<String> user

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.

String id

Identifier of the thread.

long createdAt

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

JsonValue; object_ "chatkit.thread"constant"chatkit.thread"constant

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:
JsonValue;
JsonValue; type "active"constant"active"constant

Status discriminator that is always active.

class Locked:

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

Optional<String> reason

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

JsonValue; type "locked"constant"locked"constant

Status discriminator that is always locked.

class Closed:

Indicates that a thread has been closed.

Optional<String> reason

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

JsonValue; type "closed"constant"closed"constant

Status discriminator that is always closed.

Optional<String> title

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

String user

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

List ChatKit threads

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.chatkit.threads.ThreadListPage;
import com.openai.models.beta.chatkit.threads.ThreadListParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        ThreadListPage page = client.beta().chatkit().threads().list();
    }
}
{
  "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"
}