SpyBara
Go Premium

java/resources/beta/subresources/chatkit/index.md 2026-07-10 23:02 UTC to 2026-07-12 06:58 UTC

8 added, 6 removed.

2026
Fri 17 17:00 Thu 16 20:57 Wed 15 02:58 Tue 14 06:58 Mon 13 15:59 Sun 12 06:58 Fri 10 23:02 Thu 9 20:58 Tue 7 08:02

ChatKit

Domain Types

ChatKit Workflow

  • class ChatKitWorkflow:

    Workflow metadata and state returned for the session.

    • String id

      Identifier of the workflow backing the session.

    • Optional<StateVariables> stateVariables

      State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided.

      • String

      • boolean

      • double

    • Tracing tracing

      Tracing settings applied to the workflow.

      • boolean enabled

        Indicates whether tracing is enabled.

    • Optional<String> version

      Specific workflow version used for the session. Defaults to null when using the latest deployment.

Sessions

Cancel chat session

ChatSession beta().chatkit().sessions().cancel(SessionCancelParamsparams = SessionCancelParams.none(), RequestOptionsrequestOptions = RequestOptions.none())

post /chatkit/sessions/{session_id}/cancel

Cancel an active ChatKit session and return its most recent metadata.

Cancelling prevents new requests from using the issued client secret.

Parameters

  • SessionCancelParams params

    • Optional<String> sessionId

Returns

  • class ChatSession:

    Represents a ChatKit session and its resolved configuration.

    • String id

      Identifier for the ChatKit session.

    • ChatSessionChatKitConfiguration chatkitConfiguration

      Resolved ChatKit feature configuration for the session.

      • ChatSessionAutomaticThreadTitling automaticThreadTitling

        Automatic thread titling preferences.

        • boolean enabled

          Whether automatic thread titling is enabled.

      • ChatSessionFileUpload fileUpload

        Upload settings for the session.

        • boolean enabled

          Indicates if uploads are enabled for the session.

        • Optional<Long> maxFileSize

          Maximum upload size in megabytes.

        • Optional<Long> maxFiles

          Maximum number of uploads allowed during the session.

      • ChatSessionHistory history

        History retention configuration.

        • boolean enabled

          Indicates if chat history is persisted for the session.

        • Optional<Long> recentThreads

          Number of prior threads surfaced in history views. Defaults to null when all history is retained.

    • String clientSecret

      Ephemeral client secret that authenticates session requests.

    • long expiresAt

      Unix timestamp (in seconds) for when the session expires.

    • long maxRequestsPer1Minute

      Convenience copy of the per-minute request limit.

    • JsonValue; object_ "chatkit.session"constant

      Type discriminator that is always chatkit.session.

      • CHATKIT_SESSION("chatkit.session")
    • ChatSessionRateLimits rateLimits

      Resolved rate limit values.

      • long maxRequestsPer1Minute

        Maximum allowed requests per one-minute window.

    • ChatSessionStatus status

      Current lifecycle state of the session.

      • ACTIVE("active")

      • EXPIRED("expired")

      • CANCELLED("cancelled")

    • String user

      User identifier associated with the session.

    • ChatKitWorkflow workflow

      Workflow metadata for the session.

      • String id

        Identifier of the workflow backing the session.

      • Optional<StateVariables> stateVariables

        State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided.

        • String

        • boolean

        • double

      • Tracing tracing

        Tracing settings applied to the workflow.

        • boolean enabled

          Indicates whether tracing is enabled.

      • Optional<String> version

        Specific workflow version used for the session. Defaults to null when using the latest deployment.

Example

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.chatkit.sessions.SessionCancelParams;
import com.openai.models.beta.chatkit.threads.ChatSession;

public final class Main {
    private Main() {}

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

        ChatSession chatSession = client.beta().chatkit().sessions().cancel("cksess_123");
    }
}

Response

{
  "id": "id",
  "chatkit_configuration": {
    "automatic_thread_titling": {
      "enabled": true
    },
    "file_upload": {
      "enabled": true,
      "max_file_size": 0,
      "max_files": 0
    },
    "history": {
      "enabled": true,
      "recent_threads": 0
    }
  },
  "client_secret": "client_secret",
  "expires_at": 0,
  "max_requests_per_1_minute": 0,
  "object": "chatkit.session",
  "rate_limits": {
    "max_requests_per_1_minute": 0
  },
  "status": "active",
  "user": "user",
  "workflow": {
    "id": "id",
    "state_variables": {
      "foo": "string"
    },
    "tracing": {
      "enabled": true
    },
    "version": "version"
  }
}

Example

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.chatkit.sessions.SessionCancelParams;
import com.openai.models.beta.chatkit.threads.ChatSession;

public final class Main {
    private Main() {}

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

        ChatSession chatSession = client.beta().chatkit().sessions().cancel("cksess_123");
    }
}

Response

{
  "id": "cksess_123",
  "object": "chatkit.session",
  "workflow": {
    "id": "workflow_alpha",
    "version": "1"
  },
  "scope": {
    "customer_id": "cust_456"
  },
  "max_requests_per_1_minute": 30,
  "ttl_seconds": 900,
  "status": "cancelled",
  "cancelled_at": 1712345678
}

Create ChatKit session

ChatSession beta().chatkit().sessions().create(SessionCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())

post /chatkit/sessions

Create a ChatKit session.

Parameters

  • SessionCreateParams params

    • String user

      A free-form string that identifies your end user; ensures this Session can access other objects that have the same user scope.

    • ChatSessionWorkflowParam workflow

      Workflow that powers the session.

    • Optional<ChatSessionChatKitConfigurationParam> chatkitConfiguration

      Optional overrides for ChatKit runtime configuration features

    • Optional<ChatSessionExpiresAfterParam> expiresAfter

      Optional override for session expiration timing in seconds from creation. Defaults to 10 minutes.

    • Optional<ChatSessionRateLimitsParam> rateLimits

      Optional override for per-minute request limits. When omitted, defaults to 10.

Returns

  • class ChatSession:

    Represents a ChatKit session and its resolved configuration.

    • String id

      Identifier for the ChatKit session.

    • ChatSessionChatKitConfiguration chatkitConfiguration

      Resolved ChatKit feature configuration for the session.

      • ChatSessionAutomaticThreadTitling automaticThreadTitling

        Automatic thread titling preferences.

        • boolean enabled

          Whether automatic thread titling is enabled.

      • ChatSessionFileUpload fileUpload

        Upload settings for the session.

        • boolean enabled

          Indicates if uploads are enabled for the session.

        • Optional<Long> maxFileSize

          Maximum upload size in megabytes.

        • Optional<Long> maxFiles

          Maximum number of uploads allowed during the session.

      • ChatSessionHistory history

        History retention configuration.

        • boolean enabled

          Indicates if chat history is persisted for the session.

        • Optional<Long> recentThreads

          Number of prior threads surfaced in history views. Defaults to null when all history is retained.

    • String clientSecret

      Ephemeral client secret that authenticates session requests.

    • long expiresAt

      Unix timestamp (in seconds) for when the session expires.

    • long maxRequestsPer1Minute

      Convenience copy of the per-minute request limit.

    • JsonValue; object_ "chatkit.session"constant

      Type discriminator that is always chatkit.session.

      • CHATKIT_SESSION("chatkit.session")
    • ChatSessionRateLimits rateLimits

      Resolved rate limit values.

      • long maxRequestsPer1Minute

        Maximum allowed requests per one-minute window.

    • ChatSessionStatus status

      Current lifecycle state of the session.

      • ACTIVE("active")

      • EXPIRED("expired")

      • CANCELLED("cancelled")

    • String user

      User identifier associated with the session.

    • ChatKitWorkflow workflow

      Workflow metadata for the session.

      • String id

        Identifier of the workflow backing the session.

      • Optional<StateVariables> stateVariables

        State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided.

        • String

        • boolean

        • double

      • Tracing tracing

        Tracing settings applied to the workflow.

        • boolean enabled

          Indicates whether tracing is enabled.

      • Optional<String> version

        Specific workflow version used for the session. Defaults to null when using the latest deployment.

Example

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.chatkit.sessions.SessionCreateParams;
import com.openai.models.beta.chatkit.threads.ChatSession;
import com.openai.models.beta.chatkit.threads.ChatSessionWorkflowParam;

public final class Main {
    private Main() {}

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

        SessionCreateParams params = SessionCreateParams.builder()
            .user("x")
            .workflow(ChatSessionWorkflowParam.builder()
                .id("id")
                .build())
            .build();
        ChatSession chatSession = client.beta().chatkit().sessions().create(params);
    }
}

Response

{
  "id": "id",
  "chatkit_configuration": {
    "automatic_thread_titling": {
      "enabled": true
    },
    "file_upload": {
      "enabled": true,
      "max_file_size": 0,
      "max_files": 0
    },
    "history": {
      "enabled": true,
      "recent_threads": 0
    }
  },
  "client_secret": "client_secret",
  "expires_at": 0,
  "max_requests_per_1_minute": 0,
  "object": "chatkit.session",
  "rate_limits": {
    "max_requests_per_1_minute": 0
  },
  "status": "active",
  "user": "user",
  "workflow": {
    "id": "id",
    "state_variables": {
      "foo": "string"
    },
    "tracing": {
      "enabled": true
    },
    "version": "version"
  }
}

Example

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.chatkit.sessions.SessionCreateParams;
import com.openai.models.beta.chatkit.threads.ChatSession;
import com.openai.models.beta.chatkit.threads.ChatSessionWorkflowParam;

public final class Main {
    private Main() {}

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

        SessionCreateParams params = SessionCreateParams.builder()
            .user("user")
            .workflow(ChatSessionWorkflowParam.builder()
                .id("id")
                .build())
            .build();
        ChatSession chatSession = client.beta().chatkit().sessions().create(params);
    }
}

Response

{
  "client_secret": "chatkit_token_123",
  "expires_at": 1735689600,
  "workflow": {
    "id": "workflow_alpha",
    "version": "2024-10-01"
  },
  "scope": {
    "project": "alpha",
    "environment": "staging"
  },
  "max_requests_per_1_minute": 60,
  "max_requests_per_session": 500,
  "status": "active"
}

Threads

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.

Parameters

  • 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.

    • Optional<Order> order

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

      • ASC("asc")

      • DESC("desc")

Returns

  • 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.

      • String id

        Identifier of the thread item.

      • List<ChatKitAttachment> attachments

        Attachments associated with the user message. Defaults to an empty list.

        • String id

          Identifier for the attachment.

        • String mimeType

          MIME type of the attachment.

        • String name

          Original display name for the attachment.

        • Optional<String> previewUrl

          Preview URL for rendering the attachment inline.

        • Type type

          Attachment discriminator.

          • IMAGE("image")

          • FILE("file")

      • List<Content> content

        Ordered content elements supplied by the user.

        • class InputText:

          Text block that a user contributed to the thread.

          • String text

            Plain-text content supplied by the user.

          • JsonValue; type "input_text"constant

            Type discriminator that is always input_text.

            • INPUT_TEXT("input_text")
        • class QuotedText:

          Quoted snippet that the user referenced in their message.

          • String text

            Quoted text content.

          • JsonValue; type "quoted_text"constant

            Type discriminator that is always quoted_text.

            • QUOTED_TEXT("quoted_text")
      • long createdAt

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

      • Optional<InferenceOptions> inferenceOptions

        Inference overrides applied to the message. Defaults to null when unset.

        • Optional<String> model

          Model name that generated the response. Defaults to null when using the session default.

        • Optional<ToolChoice> toolChoice

          Preferred tool to invoke. Defaults to null when ChatKit should auto-select.

          • String id

            Identifier of the requested tool.

      • JsonValue; object_ "chatkit.thread_item"constant

        Type discriminator that is always chatkit.thread_item.

        • CHATKIT_THREAD_ITEM("chatkit.thread_item")
      • String threadId

        Identifier of the parent thread.

      • JsonValue; type "chatkit.user_message"constant

        • CHATKIT_USER_MESSAGE("chatkit.user_message")
    • class ChatKitThreadAssistantMessageItem:

      Assistant-authored message within a thread.

      • String id

        Identifier of the thread item.

      • List<ChatKitResponseOutputText> content

        Ordered assistant response segments.

        • List<Annotation> annotations

          Ordered list of annotations attached to the response text.

          • class File:

            Annotation that references an uploaded file.

            • Source source

              File attachment referenced by the annotation.

              • String filename

                Filename referenced by the annotation.

              • JsonValue; type "file"constant

                Type discriminator that is always file.

                • FILE("file")
            • JsonValue; type "file"constant

              Type discriminator that is always file for this annotation.

              • FILE("file")
          • class Url:

            Annotation that references a URL.

            • Source source

              URL referenced by the annotation.

              • JsonValue; type "url"constant

                Type discriminator that is always url.

                • URL("url")
              • String url

                URL referenced by the annotation.

            • JsonValue; type "url"constant

              Type discriminator that is always url for this annotation.

              • URL("url")
        • String text

          Assistant generated text.

        • JsonValue; type "output_text"constant

          Type discriminator that is always output_text.

          • OUTPUT_TEXT("output_text")
      • long createdAt

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

      • JsonValue; object_ "chatkit.thread_item"constant

        Type discriminator that is always chatkit.thread_item.

        • CHATKIT_THREAD_ITEM("chatkit.thread_item")
      • String threadId

        Identifier of the parent thread.

      • JsonValue; type "chatkit.assistant_message"constant

        Type discriminator that is always chatkit.assistant_message.

        • CHATKIT_ASSISTANT_MESSAGE("chatkit.assistant_message")
    • class ChatKitWidgetItem:

      Thread item that renders a widget payload.

      • String id

        Identifier of the thread item.

      • long createdAt

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

      • JsonValue; object_ "chatkit.thread_item"constant

        Type discriminator that is always chatkit.thread_item.

        • CHATKIT_THREAD_ITEM("chatkit.thread_item")
      • String threadId

        Identifier of the parent thread.

      • JsonValue; type "chatkit.widget"constant

        Type discriminator that is always chatkit.widget.

        • CHATKIT_WIDGET("chatkit.widget")
      • String widget

        Serialized widget payload rendered in the UI.

    • class ChatKitClientToolCall:

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

      • String id

        Identifier of the thread item.

      • String arguments

        JSON-encoded arguments that were sent to the tool.

      • String callId

        Identifier for the client tool call.

      • long createdAt

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

      • String name

        Tool name that was invoked.

      • JsonValue; object_ "chatkit.thread_item"constant

        Type discriminator that is always chatkit.thread_item.

        • CHATKIT_THREAD_ITEM("chatkit.thread_item")
      • Optional<String> output

        JSON-encoded output captured from the tool. Defaults to null while execution is in progress.

      • Status status

        Execution status for the tool call.

        • IN_PROGRESS("in_progress")

        • COMPLETED("completed")

      • String threadId

        Identifier of the parent thread.

      • JsonValue; type "chatkit.client_tool_call"constant

        Type discriminator that is always chatkit.client_tool_call.

        • CHATKIT_CLIENT_TOOL_CALL("chatkit.client_tool_call")
    • class ChatKitTask:

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

      • String id

        Identifier of the thread item.

      • long createdAt

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

      • Optional<String> heading

        Optional heading for the task. Defaults to null when not provided.

      • JsonValue; object_ "chatkit.thread_item"constant

        Type discriminator that is always chatkit.thread_item.

        • CHATKIT_THREAD_ITEM("chatkit.thread_item")
      • Optional<String> summary

        Optional summary that describes the task. Defaults to null when omitted.

      • TaskType taskType

        Subtype for the task.

        • CUSTOM("custom")

        • THOUGHT("thought")

      • String threadId

        Identifier of the parent thread.

      • JsonValue; type "chatkit.task"constant

        Type discriminator that is always chatkit.task.

        • CHATKIT_TASK("chatkit.task")
    • class ChatKitTaskGroup:

      Collection of workflow tasks grouped together in the thread.

      • String id

        Identifier of the thread item.

      • long createdAt

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

      • JsonValue; object_ "chatkit.thread_item"constant

        Type discriminator that is always chatkit.thread_item.

        • CHATKIT_THREAD_ITEM("chatkit.thread_item")
      • List<Task> tasks

        Tasks included in the group.

        • Optional<String> heading

          Optional heading for the grouped task. Defaults to null when not provided.

        • Optional<String> summary

          Optional summary that describes the grouped task. Defaults to null when omitted.

        • Type type

          Subtype for the grouped task.

          • CUSTOM("custom")

          • THOUGHT("thought")

      • String threadId

        Identifier of the parent thread.

      • JsonValue; type "chatkit.task_group"constant

        Type discriminator that is always chatkit.task_group.

        • CHATKIT_TASK_GROUP("chatkit.task_group")

Example

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");
    }
}

Response

{
  "data": [
    {
      "id": "id",
      "attachments": [
        {
          "id": "id",
          "mime_type": "mime_type",
          "name": "name",
          "preview_url": "https://example.com",
          "type": "image"
        }
      ],
      "content": [
        {
          "text": "text",
          "type": "input_text"
        }
      ],
      "created_at": 0,
      "inference_options": {
        "model": "model",
        "tool_choice": {
          "id": "id"
        }
      },
      "object": "chatkit.thread_item",
      "thread_id": "thread_id",
      "type": "chatkit.user_message"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id",
  "object": "list"
}

Example

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");
    }
}

Response

{
  "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"
}

Retrieve ChatKit thread

ChatKitThread beta().chatkit().threads().retrieve(ThreadRetrieveParamsparams = ThreadRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())

get /chatkit/threads/{thread_id}

Retrieve a ChatKit thread by its identifier.

Parameters

  • ThreadRetrieveParams params

    • Optional<String> threadId

Returns

  • 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

      Type discriminator that is always chatkit.thread.

      • CHATKIT_THREAD("chatkit.thread")
    • Status status

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

      • JsonValue;

        • JsonValue; type "active"constant

          Status discriminator that is always active.

          • ACTIVE("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

          Status discriminator that is always locked.

          • LOCKED("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

          Status discriminator that is always closed.

          • CLOSED("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.

Example

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.chatkit.threads.ChatKitThread;
import com.openai.models.beta.chatkit.threads.ThreadRetrieveParams;

public final class Main {
    private Main() {}

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

        ChatKitThread chatkitThread = client.beta().chatkit().threads().retrieve("cthr_123");
    }
}

Response

{
  "id": "cthr_def456",
  "created_at": 1712345600,
  "object": "chatkit.thread",
  "status": {
    "type": "active"
  },
  "title": "Demo feedback",
  "user": "user_456"
}

Example

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.chatkit.threads.ChatKitThread;
import com.openai.models.beta.chatkit.threads.ThreadRetrieveParams;

public final class Main {
    private Main() {}

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

        ChatKitThread chatkitThread = client.beta().chatkit().threads().retrieve("cthr_123");
    }
}

Response

{
  "id": "cthr_abc123",
  "object": "chatkit.thread",
  "title": "Customer escalation",
  "items": {
    "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
  }
}

Delete ChatKit thread

ThreadDeleteResponse beta().chatkit().threads().delete(ThreadDeleteParamsparams = ThreadDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())

delete /chatkit/threads/{thread_id}

Delete a ChatKit thread along with its items and stored attachments.

Parameters

  • ThreadDeleteParams params

    • Optional<String> threadId

Returns

  • class ThreadDeleteResponse:

    Confirmation payload returned after deleting a thread.

    • String id

      Identifier of the deleted thread.

    • boolean deleted

      Indicates that the thread has been deleted.

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

      Type discriminator that is always chatkit.thread.deleted.

      • CHATKIT_THREAD_DELETED("chatkit.thread.deleted")

Example

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.chatkit.threads.ThreadDeleteParams;
import com.openai.models.beta.chatkit.threads.ThreadDeleteResponse;

public final class Main {
    private Main() {}

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

        ThreadDeleteResponse thread = client.beta().chatkit().threads().delete("cthr_123");
    }
}

Response

{
  "id": "id",
  "deleted": true,
  "object": "chatkit.thread.deleted"
}

Example

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.chat_kit.threads.ThreadDeleteParams;
import com.openai.models.beta.chat_kit.threads.ThreadDeleteResponse;

public final class Main {
    private Main() {}

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

        ThreadDeleteResponse thread = client.beta().chat_kit().threads().delete("cthr_123");
    }
}

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.

Parameters

  • 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.

    • 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.

Returns

  • 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

      Type discriminator that is always chatkit.thread.

      • CHATKIT_THREAD("chatkit.thread")
    • Status status

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

      • JsonValue;

        • JsonValue; type "active"constant

          Status discriminator that is always active.

          • ACTIVE("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

          Status discriminator that is always locked.

          • LOCKED("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

          Status discriminator that is always closed.

          • CLOSED("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.

Example

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();
    }
}

Response

{
  "data": [
    {
      "id": "cthr_def456",
      "created_at": 1712345600,
      "object": "chatkit.thread",
      "status": {
        "type": "active"
      },
      "title": "Demo feedback",
      "user": "user_456"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id",
  "object": "list"
}

Example

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();
    }
}

Response

{
  "data": [
    {
      "id": "cthr_abc123",
      "object": "chatkit.thread",
      "title": "Customer escalation"
    },
    {
      "id": "cthr_def456",
      "object": "chatkit.thread",
      "title": "Demo feedback"
    }
  ],
  "has_more": false,
  "object": "list"
}

Domain Types

Chat Session

  • class ChatSession:

    Represents a ChatKit session and its resolved configuration.

    • String id

      Identifier for the ChatKit session.

    • ChatSessionChatKitConfiguration chatkitConfiguration

      Resolved ChatKit feature configuration for the session.

      • ChatSessionAutomaticThreadTitling automaticThreadTitling

        Automatic thread titling preferences.

        • boolean enabled

          Whether automatic thread titling is enabled.

      • ChatSessionFileUpload fileUpload

        Upload settings for the session.

        • boolean enabled

          Indicates if uploads are enabled for the session.

        • Optional<Long> maxFileSize

          Maximum upload size in megabytes.

        • Optional<Long> maxFiles

          Maximum number of uploads allowed during the session.

      • ChatSessionHistory history

        History retention configuration.

        • boolean enabled

          Indicates if chat history is persisted for the session.

        • Optional<Long> recentThreads

          Number of prior threads surfaced in history views. Defaults to null when all history is retained.

    • String clientSecret

      Ephemeral client secret that authenticates session requests.

    • long expiresAt

      Unix timestamp (in seconds) for when the session expires.

    • long maxRequestsPer1Minute

      Convenience copy of the per-minute request limit.

    • JsonValue; object_ "chatkit.session"constant

      Type discriminator that is always chatkit.session.

      • CHATKIT_SESSION("chatkit.session")
    • ChatSessionRateLimits rateLimits

      Resolved rate limit values.

      • long maxRequestsPer1Minute

        Maximum allowed requests per one-minute window.

    • ChatSessionStatus status

      Current lifecycle state of the session.

      • ACTIVE("active")

      • EXPIRED("expired")

      • CANCELLED("cancelled")

    • String user

      User identifier associated with the session.

    • ChatKitWorkflow workflow

      Workflow metadata for the session.

      • String id

        Identifier of the workflow backing the session.

      • Optional<StateVariables> stateVariables

        State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided.

        • String

        • boolean

        • double

      • Tracing tracing

        Tracing settings applied to the workflow.

        • boolean enabled

          Indicates whether tracing is enabled.

      • Optional<String> version

        Specific workflow version used for the session. Defaults to null when using the latest deployment.

Chat Session Automatic Thread Titling

  • class ChatSessionAutomaticThreadTitling:

    Automatic thread title preferences for the session.

    • boolean enabled

      Whether automatic thread titling is enabled.

Chat Session ChatKit Configuration

  • class ChatSessionChatKitConfiguration:

    ChatKit configuration for the session.

    • ChatSessionAutomaticThreadTitling automaticThreadTitling

      Automatic thread titling preferences.

      • boolean enabled

        Whether automatic thread titling is enabled.

    • ChatSessionFileUpload fileUpload

      Upload settings for the session.

      • boolean enabled

        Indicates if uploads are enabled for the session.

      • Optional<Long> maxFileSize

        Maximum upload size in megabytes.

      • Optional<Long> maxFiles

        Maximum number of uploads allowed during the session.

    • ChatSessionHistory history

      History retention configuration.

      • boolean enabled

        Indicates if chat history is persisted for the session.

      • Optional<Long> recentThreads

        Number of prior threads surfaced in history views. Defaults to null when all history is retained.

Chat Session ChatKit Configuration Param

  • class ChatSessionChatKitConfigurationParam:

    Optional per-session configuration settings for ChatKit behavior.

    • Optional<AutomaticThreadTitling> automaticThreadTitling

      Configuration for automatic thread titling. When omitted, automatic thread titling is enabled by default.

      • Optional<Boolean> enabled

        Enable automatic thread title generation. Defaults to true.

    • Optional<FileUpload> fileUpload

      Configuration for upload enablement and limits. When omitted, uploads are disabled by default (max_files 10, max_file_size 512 MB).

      • Optional<Boolean> enabled

        Enable uploads for this session. Defaults to false.

      • Optional<Long> maxFileSize

        Maximum size in megabytes for each uploaded file. Defaults to 512 MB, which is the maximum allowable size.

      • Optional<Long> maxFiles

        Maximum number of files that can be uploaded to the session. Defaults to 10.

    • Optional<History> history

      Configuration for chat history retention. When omitted, history is enabled by default with no limit on recent_threads (null).

      • Optional<Boolean> enabled

        Enables chat users to access previous ChatKit threads. Defaults to true.

      • Optional<Long> recentThreads

        Number of recent ChatKit threads users have access to. Defaults to unlimited when unset.

Chat Session Expires After Param

  • class ChatSessionExpiresAfterParam:

    Controls when the session expires relative to an anchor timestamp.

    • JsonValue; anchor "created_at"constant

      Base timestamp used to calculate expiration. Currently fixed to created_at.

      • CREATED_AT("created_at")
    • long seconds

      Number of seconds after the anchor when the session expires.

Chat Session File Upload

  • class ChatSessionFileUpload:

    Upload permissions and limits applied to the session.

    • boolean enabled

      Indicates if uploads are enabled for the session.

    • Optional<Long> maxFileSize

      Maximum upload size in megabytes.

    • Optional<Long> maxFiles

      Maximum number of uploads allowed during the session.

Chat Session History

  • class ChatSessionHistory:

    History retention preferences returned for the session.

    • boolean enabled

      Indicates if chat history is persisted for the session.

    • Optional<Long> recentThreads

      Number of prior threads surfaced in history views. Defaults to null when all history is retained.

Chat Session Rate Limits

  • class ChatSessionRateLimits:

    Active per-minute request limit for the session.

    • long maxRequestsPer1Minute

      Maximum allowed requests per one-minute window.

Chat Session Rate Limits Param

  • class ChatSessionRateLimitsParam:

    Controls request rate limits for the session.

    • Optional<Long> maxRequestsPer1Minute

      Maximum number of requests allowed per minute for the session. Defaults to 10.

Chat Session Status

  • enum ChatSessionStatus:

    • ACTIVE("active")

    • EXPIRED("expired")

    • CANCELLED("cancelled")

Chat Session Workflow Param

  • class ChatSessionWorkflowParam:

    Workflow reference and overrides applied to the chat session.

    • String id

      Identifier for the workflow invoked by the session.

    • Optional<StateVariables> stateVariables

      State variables forwarded to the workflow. Keys may be up to 64 characters, values must be primitive types, and the map defaults to an empty object.

      • String

      • boolean

      • double

    • Optional<Tracing> tracing

      Optional tracing overrides for the workflow invocation. When omitted, tracing is enabled by default.

      • Optional<Boolean> enabled

        Whether tracing is enabled during the session. Defaults to true.

    • Optional<String> version

      Specific workflow version to run. Defaults to the latest deployed version.

ChatKit Attachment

  • class ChatKitAttachment:

    Attachment metadata included on thread items.

    • String id

      Identifier for the attachment.

    • String mimeType

      MIME type of the attachment.

    • String name

      Original display name for the attachment.

    • Optional<String> previewUrl

      Preview URL for rendering the attachment inline.

    • Type type

      Attachment discriminator.

      • IMAGE("image")

      • FILE("file")

ChatKit Response Output Text

  • class ChatKitResponseOutputText:

    Assistant response text accompanied by optional annotations.

    • List<Annotation> annotations

      Ordered list of annotations attached to the response text.

      • class File:

        Annotation that references an uploaded file.

        • Source source

          File attachment referenced by the annotation.

          • String filename

            Filename referenced by the annotation.

          • JsonValue; type "file"constant

            Type discriminator that is always file.

            • FILE("file")
        • JsonValue; type "file"constant

          Type discriminator that is always file for this annotation.

          • FILE("file")
      • class Url:

        Annotation that references a URL.

        • Source source

          URL referenced by the annotation.

          • JsonValue; type "url"constant

            Type discriminator that is always url.

            • URL("url")
          • String url

            URL referenced by the annotation.

        • JsonValue; type "url"constant

          Type discriminator that is always url for this annotation.

          • URL("url")
    • String text

      Assistant generated text.

    • JsonValue; type "output_text"constant

      Type discriminator that is always output_text.

      • OUTPUT_TEXT("output_text")

ChatKit Thread

  • 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

      Type discriminator that is always chatkit.thread.

      • CHATKIT_THREAD("chatkit.thread")
    • Status status

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

      • JsonValue;

        • JsonValue; type "active"constant

          Status discriminator that is always active.

          • ACTIVE("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

          Status discriminator that is always locked.

          • LOCKED("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

          Status discriminator that is always closed.

          • CLOSED("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.

ChatKit Thread Assistant Message Item

  • class ChatKitThreadAssistantMessageItem:

    Assistant-authored message within a thread.

    • String id

      Identifier of the thread item.

    • List<ChatKitResponseOutputText> content

      Ordered assistant response segments.

      • List<Annotation> annotations

        Ordered list of annotations attached to the response text.

        • class File:

          Annotation that references an uploaded file.

          • Source source

            File attachment referenced by the annotation.

            • String filename

              Filename referenced by the annotation.

            • JsonValue; type "file"constant

              Type discriminator that is always file.

              • FILE("file")
          • JsonValue; type "file"constant

            Type discriminator that is always file for this annotation.

            • FILE("file")
        • class Url:

          Annotation that references a URL.

          • Source source

            URL referenced by the annotation.

            • JsonValue; type "url"constant

              Type discriminator that is always url.

              • URL("url")
            • String url

              URL referenced by the annotation.

          • JsonValue; type "url"constant

            Type discriminator that is always url for this annotation.

            • URL("url")
      • String text

        Assistant generated text.

      • JsonValue; type "output_text"constant

        Type discriminator that is always output_text.

        • OUTPUT_TEXT("output_text")
    • long createdAt

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

    • JsonValue; object_ "chatkit.thread_item"constant

      Type discriminator that is always chatkit.thread_item.

      • CHATKIT_THREAD_ITEM("chatkit.thread_item")
    • String threadId

      Identifier of the parent thread.

    • JsonValue; type "chatkit.assistant_message"constant

      Type discriminator that is always chatkit.assistant_message.

      • CHATKIT_ASSISTANT_MESSAGE("chatkit.assistant_message")

ChatKit Thread Item List

  • class ChatKitThreadItemList:

    A paginated list of thread items rendered for the ChatKit API.

    • List<Data> data

      A list of items

      • class ChatKitThreadUserMessageItem:

        User-authored messages within a thread.

        • String id

          Identifier of the thread item.

        • List<ChatKitAttachment> attachments

          Attachments associated with the user message. Defaults to an empty list.

          • String id

            Identifier for the attachment.

          • String mimeType

            MIME type of the attachment.

          • String name

            Original display name for the attachment.

          • Optional<String> previewUrl

            Preview URL for rendering the attachment inline.

          • Type type

            Attachment discriminator.

            • IMAGE("image")

            • FILE("file")

        • List<Content> content

          Ordered content elements supplied by the user.

          • class InputText:

            Text block that a user contributed to the thread.

            • String text

              Plain-text content supplied by the user.

            • JsonValue; type "input_text"constant

              Type discriminator that is always input_text.

              • INPUT_TEXT("input_text")
          • class QuotedText:

            Quoted snippet that the user referenced in their message.

            • String text

              Quoted text content.

            • JsonValue; type "quoted_text"constant

              Type discriminator that is always quoted_text.

              • QUOTED_TEXT("quoted_text")
        • long createdAt

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

        • Optional<InferenceOptions> inferenceOptions

          Inference overrides applied to the message. Defaults to null when unset.

          • Optional<String> model

            Model name that generated the response. Defaults to null when using the session default.

          • Optional<ToolChoice> toolChoice

            Preferred tool to invoke. Defaults to null when ChatKit should auto-select.

            • String id

              Identifier of the requested tool.

        • JsonValue; object_ "chatkit.thread_item"constant

          Type discriminator that is always chatkit.thread_item.

          • CHATKIT_THREAD_ITEM("chatkit.thread_item")
        • String threadId

          Identifier of the parent thread.

        • JsonValue; type "chatkit.user_message"constant

          • CHATKIT_USER_MESSAGE("chatkit.user_message")
      • class ChatKitThreadAssistantMessageItem:

        Assistant-authored message within a thread.

        • String id

          Identifier of the thread item.

        • List<ChatKitResponseOutputText> content

          Ordered assistant response segments.

          • List<Annotation> annotations

            Ordered list of annotations attached to the response text.

            • class File:

              Annotation that references an uploaded file.

              • Source source

                File attachment referenced by the annotation.

                • String filename

                  Filename referenced by the annotation.

                • JsonValue; type "file"constant

                  Type discriminator that is always file.

                  • FILE("file")
              • JsonValue; type "file"constant

                Type discriminator that is always file for this annotation.

                • FILE("file")
            • class Url:

              Annotation that references a URL.

              • Source source

                URL referenced by the annotation.

                • JsonValue; type "url"constant

                  Type discriminator that is always url.

                  • URL("url")
                • String url

                  URL referenced by the annotation.

              • JsonValue; type "url"constant

                Type discriminator that is always url for this annotation.

                • URL("url")
          • String text

            Assistant generated text.

          • JsonValue; type "output_text"constant

            Type discriminator that is always output_text.

            • OUTPUT_TEXT("output_text")
        • long createdAt

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

        • JsonValue; object_ "chatkit.thread_item"constant

          Type discriminator that is always chatkit.thread_item.

          • CHATKIT_THREAD_ITEM("chatkit.thread_item")
        • String threadId

          Identifier of the parent thread.

        • JsonValue; type "chatkit.assistant_message"constant

          Type discriminator that is always chatkit.assistant_message.

          • CHATKIT_ASSISTANT_MESSAGE("chatkit.assistant_message")
      • class ChatKitWidgetItem:

        Thread item that renders a widget payload.

        • String id

          Identifier of the thread item.

        • long createdAt

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

        • JsonValue; object_ "chatkit.thread_item"constant

          Type discriminator that is always chatkit.thread_item.

          • CHATKIT_THREAD_ITEM("chatkit.thread_item")
        • String threadId

          Identifier of the parent thread.

        • JsonValue; type "chatkit.widget"constant

          Type discriminator that is always chatkit.widget.

          • CHATKIT_WIDGET("chatkit.widget")
        • String widget

          Serialized widget payload rendered in the UI.

      • class ChatKitClientToolCall:

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

        • String id

          Identifier of the thread item.

        • String arguments

          JSON-encoded arguments that were sent to the tool.

        • String callId

          Identifier for the client tool call.

        • long createdAt

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

        • String name

          Tool name that was invoked.

        • JsonValue; object_ "chatkit.thread_item"constant

          Type discriminator that is always chatkit.thread_item.

          • CHATKIT_THREAD_ITEM("chatkit.thread_item")
        • Optional<String> output

          JSON-encoded output captured from the tool. Defaults to null while execution is in progress.

        • Status status

          Execution status for the tool call.

          • IN_PROGRESS("in_progress")

          • COMPLETED("completed")

        • String threadId

          Identifier of the parent thread.

        • JsonValue; type "chatkit.client_tool_call"constant

          Type discriminator that is always chatkit.client_tool_call.

          • CHATKIT_CLIENT_TOOL_CALL("chatkit.client_tool_call")
      • class ChatKitTask:

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

        • String id

          Identifier of the thread item.

        • long createdAt

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

        • Optional<String> heading

          Optional heading for the task. Defaults to null when not provided.

        • JsonValue; object_ "chatkit.thread_item"constant

          Type discriminator that is always chatkit.thread_item.

          • CHATKIT_THREAD_ITEM("chatkit.thread_item")
        • Optional<String> summary

          Optional summary that describes the task. Defaults to null when omitted.

        • TaskType taskType

          Subtype for the task.

          • CUSTOM("custom")

          • THOUGHT("thought")

        • String threadId

          Identifier of the parent thread.

        • JsonValue; type "chatkit.task"constant

          Type discriminator that is always chatkit.task.

          • CHATKIT_TASK("chatkit.task")
      • class ChatKitTaskGroup:

        Collection of workflow tasks grouped together in the thread.

        • String id

          Identifier of the thread item.

        • long createdAt

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

        • JsonValue; object_ "chatkit.thread_item"constant

          Type discriminator that is always chatkit.thread_item.

          • CHATKIT_THREAD_ITEM("chatkit.thread_item")
        • List<Task> tasks

          Tasks included in the group.

          • Optional<String> heading

            Optional heading for the grouped task. Defaults to null when not provided.

          • Optional<String> summary

            Optional summary that describes the grouped task. Defaults to null when omitted.

          • Type type

            Subtype for the grouped task.

            • CUSTOM("custom")

            • THOUGHT("thought")

        • String threadId

          Identifier of the parent thread.

        • JsonValue; type "chatkit.task_group"constant

          Type discriminator that is always chatkit.task_group.

          • CHATKIT_TASK_GROUP("chatkit.task_group")
    • Optional<String> firstId

      The ID of the first item in the list.

    • boolean hasMore

      Whether there are more items available.

    • Optional<String> lastId

      The ID of the last item in the list.

    • JsonValue; object_ "list"constant

      The type of object returned, must be list.

      • LIST("list")

ChatKit Thread User Message Item

  • class ChatKitThreadUserMessageItem:

    User-authored messages within a thread.

    • String id

      Identifier of the thread item.

    • List<ChatKitAttachment> attachments

      Attachments associated with the user message. Defaults to an empty list.

      • String id

        Identifier for the attachment.

      • String mimeType

        MIME type of the attachment.

      • String name

        Original display name for the attachment.

      • Optional<String> previewUrl

        Preview URL for rendering the attachment inline.

      • Type type

        Attachment discriminator.

        • IMAGE("image")

        • FILE("file")

    • List<Content> content

      Ordered content elements supplied by the user.

      • class InputText:

        Text block that a user contributed to the thread.

        • String text

          Plain-text content supplied by the user.

        • JsonValue; type "input_text"constant

          Type discriminator that is always input_text.

          • INPUT_TEXT("input_text")
      • class QuotedText:

        Quoted snippet that the user referenced in their message.

        • String text

          Quoted text content.

        • JsonValue; type "quoted_text"constant

          Type discriminator that is always quoted_text.

          • QUOTED_TEXT("quoted_text")
    • long createdAt

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

    • Optional<InferenceOptions> inferenceOptions

      Inference overrides applied to the message. Defaults to null when unset.

      • Optional<String> model

        Model name that generated the response. Defaults to null when using the session default.

      • Optional<ToolChoice> toolChoice

        Preferred tool to invoke. Defaults to null when ChatKit should auto-select.

        • String id

          Identifier of the requested tool.

    • JsonValue; object_ "chatkit.thread_item"constant

      Type discriminator that is always chatkit.thread_item.

      • CHATKIT_THREAD_ITEM("chatkit.thread_item")
    • String threadId

      Identifier of the parent thread.

    • JsonValue; type "chatkit.user_message"constant

      • CHATKIT_USER_MESSAGE("chatkit.user_message")

ChatKit Widget Item

  • class ChatKitWidgetItem:

    Thread item that renders a widget payload.

    • String id

      Identifier of the thread item.

    • long createdAt

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

    • JsonValue; object_ "chatkit.thread_item"constant

      Type discriminator that is always chatkit.thread_item.

      • CHATKIT_THREAD_ITEM("chatkit.thread_item")
    • String threadId

      Identifier of the parent thread.

    • JsonValue; type "chatkit.widget"constant

      Type discriminator that is always chatkit.widget.

      • CHATKIT_WIDGET("chatkit.widget")
    • String widget

      Serialized widget payload rendered in the UI.