Skip to content

ChatKit

ModelsExpand Collapse
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.

Accepts one of the following:
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.

ChatKitSessions

Cancel chat session
ChatSession beta().chatkit().sessions().cancel(SessionCancelParamsparams = SessionCancelParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
POST/chatkit/sessions/{session_id}/cancel
Create ChatKit session
ChatSession beta().chatkit().sessions().create(SessionCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/chatkit/sessions

ChatKitThreads

List ChatKit thread items
ThreadListItemsPage beta().chatkit().threads().listItems(ThreadListItemsParamsparams = ThreadListItemsParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/chatkit/threads/{thread_id}/items
Retrieve ChatKit thread
ChatKitThread beta().chatkit().threads().retrieve(ThreadRetrieveParamsparams = ThreadRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/chatkit/threads/{thread_id}
Delete ChatKit thread
ThreadDeleteResponse beta().chatkit().threads().delete(ThreadDeleteParamsparams = ThreadDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
DELETE/chatkit/threads/{thread_id}
List ChatKit threads
ThreadListPage beta().chatkit().threads().list(ThreadListParamsparams = ThreadListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/chatkit/threads
ModelsExpand Collapse
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.

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"chatkit.session"constant

Type discriminator that is always chatkit.session.

Resolved rate limit values.

Current lifecycle state of the session.

String user

User identifier associated with the session.

Workflow metadata for the session.

class ChatSessionAutomaticThreadTitling:

Automatic thread title preferences for the session.

boolean enabled

Whether automatic thread titling is enabled.

class ChatSessionChatKitConfiguration:

ChatKit configuration for the session.

ChatSessionAutomaticThreadTitling automaticThreadTitling

Automatic thread titling preferences.

Upload settings for the session.

History retention configuration.

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.

maximum512
minimum1
Optional<Long> maxFiles

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

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

minimum1
class ChatSessionExpiresAfterParam:

Controls when the session expires relative to an anchor timestamp.

JsonValue; anchor "created_at"constant"created_at"constant

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

long seconds

Number of seconds after the anchor when the session expires.

maximum600
minimum1
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.

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.

class ChatSessionRateLimits:

Active per-minute request limit for the session.

long maxRequestsPer1Minute

Maximum allowed requests per one-minute window.

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.

minimum1
enum ChatSessionStatus:
ACTIVE("active")
EXPIRED("expired")
CANCELLED("cancelled")
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.

Accepts one of the following:
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.

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.

Accepts one of the following:
IMAGE("image")
FILE("file")
class ChatKitResponseOutputText:

Assistant response text accompanied by optional annotations.

List<Annotation> annotations

Ordered list of annotations attached to the response text.

Accepts one of the following:
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"file"constant

Type discriminator that is always file.

JsonValue; type "file"constant"file"constant

Type discriminator that is always file for this annotation.

class Url:

Annotation that references a URL.

Source source

URL referenced by the annotation.

JsonValue; type "url"constant"url"constant

Type discriminator that is always url.

String url

URL referenced by the annotation.

JsonValue; type "url"constant"url"constant

Type discriminator that is always url for this annotation.

String text

Assistant generated text.

JsonValue; type "output_text"constant"output_text"constant

Type discriminator that is always output_text.

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.

class ChatKitThreadAssistantMessageItem:

Assistant-authored message within a thread.

String id

Identifier of the thread item.

Ordered assistant response segments.

List<Annotation> annotations

Ordered list of annotations attached to the response text.

Accepts one of the following:
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"file"constant

Type discriminator that is always file.

JsonValue; type "file"constant"file"constant

Type discriminator that is always file for this annotation.

class Url:

Annotation that references a URL.

Source source

URL referenced by the annotation.

JsonValue; type "url"constant"url"constant

Type discriminator that is always url.

String url

URL referenced by the annotation.

JsonValue; type "url"constant"url"constant

Type discriminator that is always url for this annotation.

String text

Assistant generated text.

JsonValue; type "output_text"constant"output_text"constant

Type discriminator that is always output_text.

long createdAt

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

JsonValue; object_ "chatkit.thread_item"constant"chatkit.thread_item"constant

Type discriminator that is always chatkit.thread_item.

String threadId

Identifier of the parent thread.

JsonValue; type "chatkit.assistant_message"constant"chatkit.assistant_message"constant

Type discriminator that is always chatkit.assistant_message.

class ChatKitThreadItemList:

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

List<Data> data

A list of items

Accepts one of the following:
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.

Accepts one of the following:
IMAGE("image")
FILE("file")
List<Content> content

Ordered content elements supplied by the user.

Accepts one of the following:
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"input_text"constant

Type discriminator that is always input_text.

class QuotedText:

Quoted snippet that the user referenced in their message.

String text

Quoted text content.

JsonValue; type "quoted_text"constant"quoted_text"constant

Type discriminator that is always 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"chatkit.thread_item"constant

Type discriminator that is always chatkit.thread_item.

String threadId

Identifier of the parent thread.

JsonValue; type "chatkit.user_message"constant"chatkit.user_message"constant
class ChatKitThreadAssistantMessageItem:

Assistant-authored message within a thread.

String id

Identifier of the thread item.

Ordered assistant response segments.

List<Annotation> annotations

Ordered list of annotations attached to the response text.

Accepts one of the following:
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"file"constant

Type discriminator that is always file.

JsonValue; type "file"constant"file"constant

Type discriminator that is always file for this annotation.

class Url:

Annotation that references a URL.

Source source

URL referenced by the annotation.

JsonValue; type "url"constant"url"constant

Type discriminator that is always url.

String url

URL referenced by the annotation.

JsonValue; type "url"constant"url"constant

Type discriminator that is always url for this annotation.

String text

Assistant generated text.

JsonValue; type "output_text"constant"output_text"constant

Type discriminator that is always output_text.

long createdAt

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

JsonValue; object_ "chatkit.thread_item"constant"chatkit.thread_item"constant

Type discriminator that is always chatkit.thread_item.

String threadId

Identifier of the parent thread.

JsonValue; type "chatkit.assistant_message"constant"chatkit.assistant_message"constant

Type discriminator that is always 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"chatkit.thread_item"constant

Type discriminator that is always chatkit.thread_item.

String threadId

Identifier of the parent thread.

JsonValue; type "chatkit.widget"constant"chatkit.widget"constant

Type discriminator that is always 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"chatkit.thread_item"constant

Type discriminator that is always 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.

Accepts one of the following:
IN_PROGRESS("in_progress")
COMPLETED("completed")
String threadId

Identifier of the parent thread.

JsonValue; type "chatkit.client_tool_call"constant"chatkit.client_tool_call"constant

Type discriminator that is always 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"chatkit.thread_item"constant

Type discriminator that is always chatkit.thread_item.

Optional<String> summary

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

TaskType taskType

Subtype for the task.

Accepts one of the following:
CUSTOM("custom")
THOUGHT("thought")
String threadId

Identifier of the parent thread.

JsonValue; type "chatkit.task"constant"chatkit.task"constant

Type discriminator that is always 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"chatkit.thread_item"constant

Type discriminator that is always 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.

Accepts one of the following:
CUSTOM("custom")
THOUGHT("thought")
String threadId

Identifier of the parent thread.

JsonValue; type "chatkit.task_group"constant"chatkit.task_group"constant

Type discriminator that is always 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"list"constant

The type of object returned, must be list.

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.

Accepts one of the following:
IMAGE("image")
FILE("file")
List<Content> content

Ordered content elements supplied by the user.

Accepts one of the following:
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"input_text"constant

Type discriminator that is always input_text.

class QuotedText:

Quoted snippet that the user referenced in their message.

String text

Quoted text content.

JsonValue; type "quoted_text"constant"quoted_text"constant

Type discriminator that is always 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"chatkit.thread_item"constant

Type discriminator that is always chatkit.thread_item.

String threadId

Identifier of the parent thread.

JsonValue; type "chatkit.user_message"constant"chatkit.user_message"constant
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"chatkit.thread_item"constant

Type discriminator that is always chatkit.thread_item.

String threadId

Identifier of the parent thread.

JsonValue; type "chatkit.widget"constant"chatkit.widget"constant

Type discriminator that is always chatkit.widget.

String widget

Serialized widget payload rendered in the UI.