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

List ChatKit thread items

ThreadListItemsPage beta().chatkit().threads().listItems(ThreadListItemsParamsparams = ThreadListItemsParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/chatkit/threads/{thread_id}/items

List items that belong to a ChatKit thread.

ParametersExpand Collapse
ThreadListItemsParams params
Optional<String> threadId
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.

ReturnsExpand Collapse
class Data: A class that can be one of several variants.union

User-authored messages within a thread.

class ChatKitThreadUserMessageItem:

User-authored messages within a thread.

class ChatKitThreadAssistantMessageItem:

Assistant-authored message within a thread.

class ChatKitWidgetItem:

Thread item that renders a widget payload.

class ChatKitClientToolCall:

Record of a client side tool invocation initiated by the assistant.

class ChatKitTask:

Task emitted by the workflow to show progress and status updates.

class ChatKitTaskGroup:

Collection of workflow tasks grouped together in the thread.

List ChatKit thread items

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.chatkit.threads.ThreadListItemsPage;
import com.openai.models.beta.chatkit.threads.ThreadListItemsParams;

public final class Main {
    private Main() {}

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

        ThreadListItemsPage page = client.beta().chatkit().threads().listItems("cthr_123");
    }
}
{
  "data": [
    {
      "id": "cthi_user_001",
      "object": "chatkit.thread_item",
      "type": "user_message",
      "content": [
        {
          "type": "input_text",
          "text": "I need help debugging an onboarding issue."
        }
      ],
      "attachments": []
    },
    {
      "id": "cthi_assistant_002",
      "object": "chatkit.thread_item",
      "type": "assistant_message",
      "content": [
        {
          "type": "output_text",
          "text": "Let's start by confirming the workflow version you deployed."
        }
      ]
    }
  ],
  "has_more": false,
  "object": "list"
}
Returns Examples
{
  "data": [
    {
      "id": "cthi_user_001",
      "object": "chatkit.thread_item",
      "type": "user_message",
      "content": [
        {
          "type": "input_text",
          "text": "I need help debugging an onboarding issue."
        }
      ],
      "attachments": []
    },
    {
      "id": "cthi_assistant_002",
      "object": "chatkit.thread_item",
      "type": "assistant_message",
      "content": [
        {
          "type": "output_text",
          "text": "Let's start by confirming the workflow version you deployed."
        }
      ]
    }
  ],
  "has_more": false,
  "object": "list"
}