SPB Git

Repository Public

chatkit.md 56.7 KB 2,620 lines markdown

1# ChatKit23> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.45## Domain Types67### ChatKit Workflow89- `ChatKitWorkflow object { id, state_variables, tracing, version }`1011  Workflow metadata and state returned for the session.1213  - `id: string`1415    Identifier of the workflow backing the session.1617  - `state_variables: map[string or boolean or number] or null`1819    State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided.2021    - `string`2223    - `boolean`2425    - `number`2627  - `tracing: object { enabled }`2829    Tracing settings applied to the workflow.3031    - `enabled: boolean`3233      Indicates whether tracing is enabled.3435  - `version: string or null`3637    Specific workflow version used for the session. Defaults to null when using the latest deployment.3839# Sessions4041## Cancel a ChatKit session4243**post** `/chatkit/sessions/{session_id}/cancel`4445Cancel an active ChatKit session and return its most recent metadata.4647Cancelling prevents new requests from using the issued client secret.4849### Path Parameters5051- `session_id: string`5253### Returns5455- `ChatSession object { id, chatkit_configuration, client_secret, 7 more }`5657  Represents a ChatKit session and its resolved configuration.5859  - `id: string`6061    Identifier for the ChatKit session.6263  - `chatkit_configuration: ChatSessionChatKitConfiguration`6465    Resolved ChatKit feature configuration for the session.6667    - `automatic_thread_titling: ChatSessionAutomaticThreadTitling`6869      Automatic thread titling preferences.7071      - `enabled: boolean`7273        Whether automatic thread titling is enabled.7475    - `file_upload: ChatSessionFileUpload`7677      Upload settings for the session.7879      - `enabled: boolean`8081        Indicates if uploads are enabled for the session.8283      - `max_file_size: number or null`8485        Maximum upload size in megabytes.8687      - `max_files: number or null`8889        Maximum number of uploads allowed during the session.9091    - `history: ChatSessionHistory`9293      History retention configuration.9495      - `enabled: boolean`9697        Indicates if chat history is persisted for the session.9899      - `recent_threads: number or null`100101        Number of prior threads surfaced in history views. Defaults to null when all history is retained.102103  - `client_secret: string`104105    Ephemeral client secret that authenticates session requests.106107  - `expires_at: number`108109    Unix timestamp (in seconds) for when the session expires.110111  - `max_requests_per_1_minute: number`112113    Convenience copy of the per-minute request limit.114115  - `object: "chatkit.session"`116117    Type discriminator that is always `chatkit.session`.118119    - `"chatkit.session"`120121  - `rate_limits: ChatSessionRateLimits`122123    Resolved rate limit values.124125    - `max_requests_per_1_minute: number`126127      Maximum allowed requests per one-minute window.128129  - `status: ChatSessionStatus`130131    Current lifecycle state of the session.132133    - `"active"`134135    - `"expired"`136137    - `"cancelled"`138139  - `user: string`140141    User identifier associated with the session.142143  - `workflow: ChatKitWorkflow`144145    Workflow metadata for the session.146147    - `id: string`148149      Identifier of the workflow backing the session.150151    - `state_variables: map[string or boolean or number] or null`152153      State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided.154155      - `string`156157      - `boolean`158159      - `number`160161    - `tracing: object { enabled }`162163      Tracing settings applied to the workflow.164165      - `enabled: boolean`166167        Indicates whether tracing is enabled.168169    - `version: string or null`170171      Specific workflow version used for the session. Defaults to null when using the latest deployment.172173### Example174175```http176curl https://api.openai.com/v1/chatkit/sessions/$SESSION_ID/cancel \177    -X POST \178    -H 'OpenAI-Beta: chatkit_beta=v1' \179    -H "Authorization: Bearer $OPENAI_API_KEY"180```181182#### Response183184```json185{186  "id": "id",187  "chatkit_configuration": {188    "automatic_thread_titling": {189      "enabled": true190    },191    "file_upload": {192      "enabled": true,193      "max_file_size": 0,194      "max_files": 0195    },196    "history": {197      "enabled": true,198      "recent_threads": 0199    }200  },201  "client_secret": "client_secret",202  "expires_at": 0,203  "max_requests_per_1_minute": 0,204  "object": "chatkit.session",205  "rate_limits": {206    "max_requests_per_1_minute": 0207  },208  "status": "active",209  "user": "user",210  "workflow": {211    "id": "id",212    "state_variables": {213      "foo": "string"214    },215    "tracing": {216      "enabled": true217    },218    "version": "version"219  }220}221```222223### Example224225```http226curl -X POST \227  https://api.openai.com/v1/chatkit/sessions/cksess_123/cancel \228  -H "OpenAI-Beta: chatkit_beta=v1" \229  -H "Authorization: Bearer $OPENAI_API_KEY"230```231232#### Response233234```json235{236  "id": "cksess_123",237  "object": "chatkit.session",238  "workflow": {239    "id": "workflow_alpha",240    "version": "1"241  },242  "scope": {243    "customer_id": "cust_456"244  },245  "max_requests_per_1_minute": 30,246  "ttl_seconds": 900,247  "status": "cancelled",248  "cancelled_at": 1712345678249}250```251252## Create a ChatKit session253254**post** `/chatkit/sessions`255256Create a ChatKit session.257258### Body Parameters259260- `user: string`261262  A free-form string that identifies your end user; ensures this Session can access other objects that have the same `user` scope.263264- `workflow: ChatSessionWorkflowParam`265266  Workflow that powers the session.267268  - `id: string`269270    Identifier for the workflow invoked by the session.271272  - `state_variables: optional map[string or boolean or number]`273274    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.275276    - `string`277278    - `boolean`279280    - `number`281282  - `tracing: optional object { enabled }`283284    Optional tracing overrides for the workflow invocation. When omitted, tracing is enabled by default.285286    - `enabled: optional boolean`287288      Whether tracing is enabled during the session. Defaults to true.289290  - `version: optional string`291292    Specific workflow version to run. Defaults to the latest deployed version.293294- `chatkit_configuration: optional ChatSessionChatKitConfigurationParam`295296  Optional overrides for ChatKit runtime configuration features297298  - `automatic_thread_titling: optional object { enabled }`299300    Configuration for automatic thread titling. When omitted, automatic thread titling is enabled by default.301302    - `enabled: optional boolean`303304      Enable automatic thread title generation. Defaults to true.305306  - `file_upload: optional object { enabled, max_file_size, max_files }`307308    Configuration for upload enablement and limits. When omitted, uploads are disabled by default (max_files 10, max_file_size 512 MB).309310    - `enabled: optional boolean`311312      Enable uploads for this session. Defaults to false.313314    - `max_file_size: optional number`315316      Maximum size in megabytes for each uploaded file. Defaults to 512 MB, which is the maximum allowable size.317318    - `max_files: optional number`319320      Maximum number of files that can be uploaded to the session. Defaults to 10.321322  - `history: optional object { enabled, recent_threads }`323324    Configuration for chat history retention. When omitted, history is enabled by default with no limit on recent_threads (null).325326    - `enabled: optional boolean`327328      Enables chat users to access previous ChatKit threads. Defaults to true.329330    - `recent_threads: optional number`331332      Number of recent ChatKit threads users have access to. Defaults to unlimited when unset.333334- `expires_after: optional ChatSessionExpiresAfterParam`335336  Optional override for session expiration timing in seconds from creation. Defaults to 10 minutes.337338  - `anchor: "created_at"`339340    Base timestamp used to calculate expiration. Currently fixed to `created_at`.341342    - `"created_at"`343344  - `seconds: number`345346    Number of seconds after the anchor when the session expires.347348- `rate_limits: optional ChatSessionRateLimitsParam`349350  Optional override for per-minute request limits. When omitted, defaults to 10.351352  - `max_requests_per_1_minute: optional number`353354    Maximum number of requests allowed per minute for the session. Defaults to 10.355356### Returns357358- `ChatSession object { id, chatkit_configuration, client_secret, 7 more }`359360  Represents a ChatKit session and its resolved configuration.361362  - `id: string`363364    Identifier for the ChatKit session.365366  - `chatkit_configuration: ChatSessionChatKitConfiguration`367368    Resolved ChatKit feature configuration for the session.369370    - `automatic_thread_titling: ChatSessionAutomaticThreadTitling`371372      Automatic thread titling preferences.373374      - `enabled: boolean`375376        Whether automatic thread titling is enabled.377378    - `file_upload: ChatSessionFileUpload`379380      Upload settings for the session.381382      - `enabled: boolean`383384        Indicates if uploads are enabled for the session.385386      - `max_file_size: number or null`387388        Maximum upload size in megabytes.389390      - `max_files: number or null`391392        Maximum number of uploads allowed during the session.393394    - `history: ChatSessionHistory`395396      History retention configuration.397398      - `enabled: boolean`399400        Indicates if chat history is persisted for the session.401402      - `recent_threads: number or null`403404        Number of prior threads surfaced in history views. Defaults to null when all history is retained.405406  - `client_secret: string`407408    Ephemeral client secret that authenticates session requests.409410  - `expires_at: number`411412    Unix timestamp (in seconds) for when the session expires.413414  - `max_requests_per_1_minute: number`415416    Convenience copy of the per-minute request limit.417418  - `object: "chatkit.session"`419420    Type discriminator that is always `chatkit.session`.421422    - `"chatkit.session"`423424  - `rate_limits: ChatSessionRateLimits`425426    Resolved rate limit values.427428    - `max_requests_per_1_minute: number`429430      Maximum allowed requests per one-minute window.431432  - `status: ChatSessionStatus`433434    Current lifecycle state of the session.435436    - `"active"`437438    - `"expired"`439440    - `"cancelled"`441442  - `user: string`443444    User identifier associated with the session.445446  - `workflow: ChatKitWorkflow`447448    Workflow metadata for the session.449450    - `id: string`451452      Identifier of the workflow backing the session.453454    - `state_variables: map[string or boolean or number] or null`455456      State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided.457458      - `string`459460      - `boolean`461462      - `number`463464    - `tracing: object { enabled }`465466      Tracing settings applied to the workflow.467468      - `enabled: boolean`469470        Indicates whether tracing is enabled.471472    - `version: string or null`473474      Specific workflow version used for the session. Defaults to null when using the latest deployment.475476### Example477478```http479curl https://api.openai.com/v1/chatkit/sessions \480    -H 'Content-Type: application/json' \481    -H 'OpenAI-Beta: chatkit_beta=v1' \482    -H "Authorization: Bearer $OPENAI_API_KEY" \483    -d '{484          "user": "x",485          "workflow": {486            "id": "id"487          }488        }'489```490491#### Response492493```json494{495  "id": "id",496  "chatkit_configuration": {497    "automatic_thread_titling": {498      "enabled": true499    },500    "file_upload": {501      "enabled": true,502      "max_file_size": 0,503      "max_files": 0504    },505    "history": {506      "enabled": true,507      "recent_threads": 0508    }509  },510  "client_secret": "client_secret",511  "expires_at": 0,512  "max_requests_per_1_minute": 0,513  "object": "chatkit.session",514  "rate_limits": {515    "max_requests_per_1_minute": 0516  },517  "status": "active",518  "user": "user",519  "workflow": {520    "id": "id",521    "state_variables": {522      "foo": "string"523    },524    "tracing": {525      "enabled": true526    },527    "version": "version"528  }529}530```531532### Example533534```http535curl https://api.openai.com/v1/chatkit/sessions \536  -H "Content-Type: application/json" \537  -H "Authorization: Bearer $OPENAI_API_KEY" \538  -H "OpenAI-Beta: chatkit_beta=v1" \539  -d '{540    "workflow": {541      "id": "workflow_alpha",542      "version": "2024-10-01"543    },544    "scope": {545      "project": "alpha",546      "environment": "staging"547    },548    "expires_after": 1800,549    "max_requests_per_1_minute": 60,550    "max_requests_per_session": 500551  }'552```553554#### Response555556```json557{558  "client_secret": "chatkit_token_123",559  "expires_at": 1735689600,560  "workflow": {561    "id": "workflow_alpha",562    "version": "2024-10-01"563  },564  "scope": {565    "project": "alpha",566    "environment": "staging"567  },568  "max_requests_per_1_minute": 60,569  "max_requests_per_session": 500,570  "status": "active"571}572```573574# Threads575576## Delete a ChatKit thread577578**delete** `/chatkit/threads/{thread_id}`579580Delete a ChatKit thread along with its items and stored attachments.581582### Path Parameters583584- `thread_id: string`585586### Returns587588- `id: string`589590  Identifier of the deleted thread.591592- `deleted: boolean`593594  Indicates that the thread has been deleted.595596- `object: "chatkit.thread.deleted"`597598  Type discriminator that is always `chatkit.thread.deleted`.599600  - `"chatkit.thread.deleted"`601602### Example603604```http605curl https://api.openai.com/v1/chatkit/threads/$THREAD_ID \606    -X DELETE \607    -H 'OpenAI-Beta: chatkit_beta=v1' \608    -H "Authorization: Bearer $OPENAI_API_KEY"609```610611#### Response612613```json614{615  "id": "id",616  "deleted": true,617  "object": "chatkit.thread.deleted"618}619```620621## List ChatKit threads622623**get** `/chatkit/threads`624625List ChatKit threads with optional pagination and user filters.626627### Query Parameters628629- `after: optional string`630631  List items created after this thread item ID. Defaults to null for the first page.632633- `before: optional string`634635  List items created before this thread item ID. Defaults to null for the newest results.636637- `limit: optional number`638639  Maximum number of thread items to return. Defaults to 20.640641- `order: optional "asc" or "desc"`642643  Sort order for results by creation time. Defaults to `desc`.644645  - `"asc"`646647  - `"desc"`648649- `user: optional string`650651  Filter threads that belong to this user identifier. Defaults to null to return all users.652653### Returns654655- `data: array of ChatKitThread`656657  A list of items658659  - `id: string`660661    Identifier of the thread.662663  - `created_at: number`664665    Unix timestamp (in seconds) for when the thread was created.666667  - `object: "chatkit.thread"`668669    Type discriminator that is always `chatkit.thread`.670671    - `"chatkit.thread"`672673  - `status: object { type }  or object { reason, type }  or object { reason, type }`674675    Current status for the thread. Defaults to `active` for newly created threads.676677    - `Active object { type }`678679      Indicates that a thread is active.680681      - `type: "active"`682683        Status discriminator that is always `active`.684685        - `"active"`686687    - `Locked object { reason, type }`688689      Indicates that a thread is locked and cannot accept new input.690691      - `reason: string or null`692693        Reason that the thread was locked. Defaults to null when no reason is recorded.694695      - `type: "locked"`696697        Status discriminator that is always `locked`.698699        - `"locked"`700701    - `Closed object { reason, type }`702703      Indicates that a thread has been closed.704705      - `reason: string or null`706707        Reason that the thread was closed. Defaults to null when no reason is recorded.708709      - `type: "closed"`710711        Status discriminator that is always `closed`.712713        - `"closed"`714715  - `title: string or null`716717    Optional human-readable title for the thread. Defaults to null when no title has been generated.718719  - `user: string`720721    Free-form string that identifies your end user who owns the thread.722723- `first_id: string or null`724725  The ID of the first item in the list.726727- `has_more: boolean`728729  Whether there are more items available.730731- `last_id: string or null`732733  The ID of the last item in the list.734735- `object: "list"`736737  The type of object returned, must be `list`.738739  - `"list"`740741### Example742743```http744curl https://api.openai.com/v1/chatkit/threads \745    -H 'OpenAI-Beta: chatkit_beta=v1' \746    -H "Authorization: Bearer $OPENAI_API_KEY"747```748749#### Response750751```json752{753  "data": [754    {755      "id": "cthr_def456",756      "created_at": 1712345600,757      "object": "chatkit.thread",758      "status": {759        "type": "active"760      },761      "title": "Demo feedback",762      "user": "user_456"763    }764  ],765  "first_id": "first_id",766  "has_more": true,767  "last_id": "last_id",768  "object": "list"769}770```771772### Example773774```http775curl "https://api.openai.com/v1/chatkit/threads?limit=2&order=desc" \776  -H "OpenAI-Beta: chatkit_beta=v1" \777  -H "Authorization: Bearer $OPENAI_API_KEY"778```779780#### Response781782```json783{784  "data": [785    {786      "id": "cthr_abc123",787      "object": "chatkit.thread",788      "title": "Customer escalation"789    },790    {791      "id": "cthr_def456",792      "object": "chatkit.thread",793      "title": "Demo feedback"794    }795  ],796  "has_more": false,797  "object": "list"798}799```800801## List ChatKit thread items802803**get** `/chatkit/threads/{thread_id}/items`804805List items that belong to a ChatKit thread.806807### Path Parameters808809- `thread_id: string`810811### Query Parameters812813- `after: optional string`814815  List items created after this thread item ID. Defaults to null for the first page.816817- `before: optional string`818819  List items created before this thread item ID. Defaults to null for the newest results.820821- `limit: optional number`822823  Maximum number of thread items to return. Defaults to 20.824825- `order: optional "asc" or "desc"`826827  Sort order for results by creation time. Defaults to `desc`.828829  - `"asc"`830831  - `"desc"`832833### Returns834835- `ChatKitThreadItemList object { data, first_id, has_more, 2 more }`836837  A paginated list of thread items rendered for the ChatKit API.838839  - `data: array of ChatKitThreadUserMessageItem or ChatKitThreadAssistantMessageItem or ChatKitWidgetItem or 3 more`840841    A list of items842843    - `ChatKitThreadUserMessageItem object { id, attachments, content, 5 more }`844845      User-authored messages within a thread.846847      - `id: string`848849        Identifier of the thread item.850851      - `attachments: array of ChatKitAttachment`852853        Attachments associated with the user message. Defaults to an empty list.854855        - `id: string`856857          Identifier for the attachment.858859        - `mime_type: string`860861          MIME type of the attachment.862863        - `name: string`864865          Original display name for the attachment.866867        - `preview_url: string or null`868869          Preview URL for rendering the attachment inline.870871        - `type: "image" or "file"`872873          Attachment discriminator.874875          - `"image"`876877          - `"file"`878879      - `content: array of object { text, type }  or object { text, type }`880881        Ordered content elements supplied by the user.882883        - `InputText object { text, type }`884885          Text block that a user contributed to the thread.886887          - `text: string`888889            Plain-text content supplied by the user.890891          - `type: "input_text"`892893            Type discriminator that is always `input_text`.894895            - `"input_text"`896897        - `QuotedText object { text, type }`898899          Quoted snippet that the user referenced in their message.900901          - `text: string`902903            Quoted text content.904905          - `type: "quoted_text"`906907            Type discriminator that is always `quoted_text`.908909            - `"quoted_text"`910911      - `created_at: number`912913        Unix timestamp (in seconds) for when the item was created.914915      - `inference_options: object { model, tool_choice }  or null`916917        Inference overrides applied to the message. Defaults to null when unset.918919        - `model: string or null`920921          Model name that generated the response. Defaults to null when using the session default.922923        - `tool_choice: object { id }  or null`924925          Preferred tool to invoke. Defaults to null when ChatKit should auto-select.926927          - `id: string`928929            Identifier of the requested tool.930931      - `object: "chatkit.thread_item"`932933        Type discriminator that is always `chatkit.thread_item`.934935        - `"chatkit.thread_item"`936937      - `thread_id: string`938939        Identifier of the parent thread.940941      - `type: "chatkit.user_message"`942943        - `"chatkit.user_message"`944945    - `ChatKitThreadAssistantMessageItem object { id, content, created_at, 3 more }`946947      Assistant-authored message within a thread.948949      - `id: string`950951        Identifier of the thread item.952953      - `content: array of ChatKitResponseOutputText`954955        Ordered assistant response segments.956957        - `annotations: array of object { source, type }  or object { source, type }`958959          Ordered list of annotations attached to the response text.960961          - `File object { source, type }`962963            Annotation that references an uploaded file.964965            - `source: object { filename, type }`966967              File attachment referenced by the annotation.968969              - `filename: string`970971                Filename referenced by the annotation.972973              - `type: "file"`974975                Type discriminator that is always `file`.976977                - `"file"`978979            - `type: "file"`980981              Type discriminator that is always `file` for this annotation.982983              - `"file"`984985          - `URL object { source, type }`986987            Annotation that references a URL.988989            - `source: object { type, url }`990991              URL referenced by the annotation.992993              - `type: "url"`994995                Type discriminator that is always `url`.996997                - `"url"`998999              - `url: string`10001001                URL referenced by the annotation.10021003            - `type: "url"`10041005              Type discriminator that is always `url` for this annotation.10061007              - `"url"`10081009        - `text: string`10101011          Assistant generated text.10121013        - `type: "output_text"`10141015          Type discriminator that is always `output_text`.10161017          - `"output_text"`10181019      - `created_at: number`10201021        Unix timestamp (in seconds) for when the item was created.10221023      - `object: "chatkit.thread_item"`10241025        Type discriminator that is always `chatkit.thread_item`.10261027        - `"chatkit.thread_item"`10281029      - `thread_id: string`10301031        Identifier of the parent thread.10321033      - `type: "chatkit.assistant_message"`10341035        Type discriminator that is always `chatkit.assistant_message`.10361037        - `"chatkit.assistant_message"`10381039    - `ChatKitWidgetItem object { id, created_at, object, 3 more }`10401041      Thread item that renders a widget payload.10421043      - `id: string`10441045        Identifier of the thread item.10461047      - `created_at: number`10481049        Unix timestamp (in seconds) for when the item was created.10501051      - `object: "chatkit.thread_item"`10521053        Type discriminator that is always `chatkit.thread_item`.10541055        - `"chatkit.thread_item"`10561057      - `thread_id: string`10581059        Identifier of the parent thread.10601061      - `type: "chatkit.widget"`10621063        Type discriminator that is always `chatkit.widget`.10641065        - `"chatkit.widget"`10661067      - `widget: string`10681069        Serialized widget payload rendered in the UI.10701071    - `ChatKitClientToolCall object { id, arguments, call_id, 7 more }`10721073      Record of a client side tool invocation initiated by the assistant.10741075      - `id: string`10761077        Identifier of the thread item.10781079      - `arguments: string`10801081        JSON-encoded arguments that were sent to the tool.10821083      - `call_id: string`10841085        Identifier for the client tool call.10861087      - `created_at: number`10881089        Unix timestamp (in seconds) for when the item was created.10901091      - `name: string`10921093        Tool name that was invoked.10941095      - `object: "chatkit.thread_item"`10961097        Type discriminator that is always `chatkit.thread_item`.10981099        - `"chatkit.thread_item"`11001101      - `output: string or null`11021103        JSON-encoded output captured from the tool. Defaults to null while execution is in progress.11041105      - `status: "in_progress" or "completed"`11061107        Execution status for the tool call.11081109        - `"in_progress"`11101111        - `"completed"`11121113      - `thread_id: string`11141115        Identifier of the parent thread.11161117      - `type: "chatkit.client_tool_call"`11181119        Type discriminator that is always `chatkit.client_tool_call`.11201121        - `"chatkit.client_tool_call"`11221123    - `ChatKitTask object { id, created_at, heading, 5 more }`11241125      Task emitted by the workflow to show progress and status updates.11261127      - `id: string`11281129        Identifier of the thread item.11301131      - `created_at: number`11321133        Unix timestamp (in seconds) for when the item was created.11341135      - `heading: string or null`11361137        Optional heading for the task. Defaults to null when not provided.11381139      - `object: "chatkit.thread_item"`11401141        Type discriminator that is always `chatkit.thread_item`.11421143        - `"chatkit.thread_item"`11441145      - `summary: string or null`11461147        Optional summary that describes the task. Defaults to null when omitted.11481149      - `task_type: "custom" or "thought"`11501151        Subtype for the task.11521153        - `"custom"`11541155        - `"thought"`11561157      - `thread_id: string`11581159        Identifier of the parent thread.11601161      - `type: "chatkit.task"`11621163        Type discriminator that is always `chatkit.task`.11641165        - `"chatkit.task"`11661167    - `ChatKitTaskGroup object { id, created_at, object, 3 more }`11681169      Collection of workflow tasks grouped together in the thread.11701171      - `id: string`11721173        Identifier of the thread item.11741175      - `created_at: number`11761177        Unix timestamp (in seconds) for when the item was created.11781179      - `object: "chatkit.thread_item"`11801181        Type discriminator that is always `chatkit.thread_item`.11821183        - `"chatkit.thread_item"`11841185      - `tasks: array of object { heading, summary, type }`11861187        Tasks included in the group.11881189        - `heading: string or null`11901191          Optional heading for the grouped task. Defaults to null when not provided.11921193        - `summary: string or null`11941195          Optional summary that describes the grouped task. Defaults to null when omitted.11961197        - `type: "custom" or "thought"`11981199          Subtype for the grouped task.12001201          - `"custom"`12021203          - `"thought"`12041205      - `thread_id: string`12061207        Identifier of the parent thread.12081209      - `type: "chatkit.task_group"`12101211        Type discriminator that is always `chatkit.task_group`.12121213        - `"chatkit.task_group"`12141215  - `first_id: string or null`12161217    The ID of the first item in the list.12181219  - `has_more: boolean`12201221    Whether there are more items available.12221223  - `last_id: string or null`12241225    The ID of the last item in the list.12261227  - `object: "list"`12281229    The type of object returned, must be `list`.12301231    - `"list"`12321233### Example12341235```http1236curl https://api.openai.com/v1/chatkit/threads/$THREAD_ID/items \1237    -H 'OpenAI-Beta: chatkit_beta=v1' \1238    -H "Authorization: Bearer $OPENAI_API_KEY"1239```12401241#### Response12421243```json1244{1245  "data": [1246    {1247      "id": "id",1248      "attachments": [1249        {1250          "id": "id",1251          "mime_type": "mime_type",1252          "name": "name",1253          "preview_url": "https://example.com",1254          "type": "image"1255        }1256      ],1257      "content": [1258        {1259          "text": "text",1260          "type": "input_text"1261        }1262      ],1263      "created_at": 0,1264      "inference_options": {1265        "model": "model",1266        "tool_choice": {1267          "id": "id"1268        }1269      },1270      "object": "chatkit.thread_item",1271      "thread_id": "thread_id",1272      "type": "chatkit.user_message"1273    }1274  ],1275  "first_id": "first_id",1276  "has_more": true,1277  "last_id": "last_id",1278  "object": "list"1279}1280```12811282### Example12831284```http1285curl "https://api.openai.com/v1/chatkit/threads/cthr_abc123/items?limit=3" \1286  -H "OpenAI-Beta: chatkit_beta=v1" \1287  -H "Authorization: Bearer $OPENAI_API_KEY"1288```12891290#### Response12911292```json1293{1294  "data": [1295    {1296      "id": "cthi_user_001",1297      "object": "chatkit.thread_item",1298      "type": "user_message",1299      "content": [1300        {1301          "type": "input_text",1302          "text": "I need help debugging an onboarding issue."1303        }1304      ],1305      "attachments": []1306    },1307    {1308      "id": "cthi_assistant_002",1309      "object": "chatkit.thread_item",1310      "type": "assistant_message",1311      "content": [1312        {1313          "type": "output_text",1314          "text": "Let's start by confirming the workflow version you deployed."1315        }1316      ]1317    }1318  ],1319  "has_more": false,1320  "object": "list"1321}1322```13231324## Retrieve a ChatKit thread13251326**get** `/chatkit/threads/{thread_id}`13271328Retrieve a ChatKit thread by its identifier.13291330### Path Parameters13311332- `thread_id: string`13331334### Returns13351336- `ChatKitThread object { id, created_at, object, 3 more }`13371338  Represents a ChatKit thread and its current status.13391340  - `id: string`13411342    Identifier of the thread.13431344  - `created_at: number`13451346    Unix timestamp (in seconds) for when the thread was created.13471348  - `object: "chatkit.thread"`13491350    Type discriminator that is always `chatkit.thread`.13511352    - `"chatkit.thread"`13531354  - `status: object { type }  or object { reason, type }  or object { reason, type }`13551356    Current status for the thread. Defaults to `active` for newly created threads.13571358    - `Active object { type }`13591360      Indicates that a thread is active.13611362      - `type: "active"`13631364        Status discriminator that is always `active`.13651366        - `"active"`13671368    - `Locked object { reason, type }`13691370      Indicates that a thread is locked and cannot accept new input.13711372      - `reason: string or null`13731374        Reason that the thread was locked. Defaults to null when no reason is recorded.13751376      - `type: "locked"`13771378        Status discriminator that is always `locked`.13791380        - `"locked"`13811382    - `Closed object { reason, type }`13831384      Indicates that a thread has been closed.13851386      - `reason: string or null`13871388        Reason that the thread was closed. Defaults to null when no reason is recorded.13891390      - `type: "closed"`13911392        Status discriminator that is always `closed`.13931394        - `"closed"`13951396  - `title: string or null`13971398    Optional human-readable title for the thread. Defaults to null when no title has been generated.13991400  - `user: string`14011402    Free-form string that identifies your end user who owns the thread.14031404### Example14051406```http1407curl https://api.openai.com/v1/chatkit/threads/$THREAD_ID \1408    -H 'OpenAI-Beta: chatkit_beta=v1' \1409    -H "Authorization: Bearer $OPENAI_API_KEY"1410```14111412#### Response14131414```json1415{1416  "id": "cthr_def456",1417  "created_at": 1712345600,1418  "object": "chatkit.thread",1419  "status": {1420    "type": "active"1421  },1422  "title": "Demo feedback",1423  "user": "user_456"1424}1425```14261427### Example14281429```http1430curl https://api.openai.com/v1/chatkit/threads/cthr_abc123 \1431  -H "OpenAI-Beta: chatkit_beta=v1" \1432  -H "Authorization: Bearer $OPENAI_API_KEY"1433```14341435#### Response14361437```json1438{1439  "id": "cthr_abc123",1440  "object": "chatkit.thread",1441  "title": "Customer escalation",1442  "items": {1443    "data": [1444      {1445        "id": "cthi_user_001",1446        "object": "chatkit.thread_item",1447        "type": "user_message",1448        "content": [1449          {1450            "type": "input_text",1451            "text": "I need help debugging an onboarding issue."1452          }1453        ],1454        "attachments": []1455      },1456      {1457        "id": "cthi_assistant_002",1458        "object": "chatkit.thread_item",1459        "type": "assistant_message",1460        "content": [1461          {1462            "type": "output_text",1463            "text": "Let's start by confirming the workflow version you deployed."1464          }1465        ]1466      }1467    ],1468    "has_more": false1469  }1470}1471```14721473## Domain Types14741475### Chat Session14761477- `ChatSession object { id, chatkit_configuration, client_secret, 7 more }`14781479  Represents a ChatKit session and its resolved configuration.14801481  - `id: string`14821483    Identifier for the ChatKit session.14841485  - `chatkit_configuration: ChatSessionChatKitConfiguration`14861487    Resolved ChatKit feature configuration for the session.14881489    - `automatic_thread_titling: ChatSessionAutomaticThreadTitling`14901491      Automatic thread titling preferences.14921493      - `enabled: boolean`14941495        Whether automatic thread titling is enabled.14961497    - `file_upload: ChatSessionFileUpload`14981499      Upload settings for the session.15001501      - `enabled: boolean`15021503        Indicates if uploads are enabled for the session.15041505      - `max_file_size: number or null`15061507        Maximum upload size in megabytes.15081509      - `max_files: number or null`15101511        Maximum number of uploads allowed during the session.15121513    - `history: ChatSessionHistory`15141515      History retention configuration.15161517      - `enabled: boolean`15181519        Indicates if chat history is persisted for the session.15201521      - `recent_threads: number or null`15221523        Number of prior threads surfaced in history views. Defaults to null when all history is retained.15241525  - `client_secret: string`15261527    Ephemeral client secret that authenticates session requests.15281529  - `expires_at: number`15301531    Unix timestamp (in seconds) for when the session expires.15321533  - `max_requests_per_1_minute: number`15341535    Convenience copy of the per-minute request limit.15361537  - `object: "chatkit.session"`15381539    Type discriminator that is always `chatkit.session`.15401541    - `"chatkit.session"`15421543  - `rate_limits: ChatSessionRateLimits`15441545    Resolved rate limit values.15461547    - `max_requests_per_1_minute: number`15481549      Maximum allowed requests per one-minute window.15501551  - `status: ChatSessionStatus`15521553    Current lifecycle state of the session.15541555    - `"active"`15561557    - `"expired"`15581559    - `"cancelled"`15601561  - `user: string`15621563    User identifier associated with the session.15641565  - `workflow: ChatKitWorkflow`15661567    Workflow metadata for the session.15681569    - `id: string`15701571      Identifier of the workflow backing the session.15721573    - `state_variables: map[string or boolean or number] or null`15741575      State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided.15761577      - `string`15781579      - `boolean`15801581      - `number`15821583    - `tracing: object { enabled }`15841585      Tracing settings applied to the workflow.15861587      - `enabled: boolean`15881589        Indicates whether tracing is enabled.15901591    - `version: string or null`15921593      Specific workflow version used for the session. Defaults to null when using the latest deployment.15941595### Chat Session Automatic Thread Titling15961597- `ChatSessionAutomaticThreadTitling object { enabled }`15981599  Automatic thread title preferences for the session.16001601  - `enabled: boolean`16021603    Whether automatic thread titling is enabled.16041605### Chat Session ChatKit Configuration16061607- `ChatSessionChatKitConfiguration object { automatic_thread_titling, file_upload, history }`16081609  ChatKit configuration for the session.16101611  - `automatic_thread_titling: ChatSessionAutomaticThreadTitling`16121613    Automatic thread titling preferences.16141615    - `enabled: boolean`16161617      Whether automatic thread titling is enabled.16181619  - `file_upload: ChatSessionFileUpload`16201621    Upload settings for the session.16221623    - `enabled: boolean`16241625      Indicates if uploads are enabled for the session.16261627    - `max_file_size: number or null`16281629      Maximum upload size in megabytes.16301631    - `max_files: number or null`16321633      Maximum number of uploads allowed during the session.16341635  - `history: ChatSessionHistory`16361637    History retention configuration.16381639    - `enabled: boolean`16401641      Indicates if chat history is persisted for the session.16421643    - `recent_threads: number or null`16441645      Number of prior threads surfaced in history views. Defaults to null when all history is retained.16461647### Chat Session ChatKit Configuration Param16481649- `ChatSessionChatKitConfigurationParam object { automatic_thread_titling, file_upload, history }`16501651  Optional per-session configuration settings for ChatKit behavior.16521653  - `automatic_thread_titling: optional object { enabled }`16541655    Configuration for automatic thread titling. When omitted, automatic thread titling is enabled by default.16561657    - `enabled: optional boolean`16581659      Enable automatic thread title generation. Defaults to true.16601661  - `file_upload: optional object { enabled, max_file_size, max_files }`16621663    Configuration for upload enablement and limits. When omitted, uploads are disabled by default (max_files 10, max_file_size 512 MB).16641665    - `enabled: optional boolean`16661667      Enable uploads for this session. Defaults to false.16681669    - `max_file_size: optional number`16701671      Maximum size in megabytes for each uploaded file. Defaults to 512 MB, which is the maximum allowable size.16721673    - `max_files: optional number`16741675      Maximum number of files that can be uploaded to the session. Defaults to 10.16761677  - `history: optional object { enabled, recent_threads }`16781679    Configuration for chat history retention. When omitted, history is enabled by default with no limit on recent_threads (null).16801681    - `enabled: optional boolean`16821683      Enables chat users to access previous ChatKit threads. Defaults to true.16841685    - `recent_threads: optional number`16861687      Number of recent ChatKit threads users have access to. Defaults to unlimited when unset.16881689### Chat Session Expires After Param16901691- `ChatSessionExpiresAfterParam object { anchor, seconds }`16921693  Controls when the session expires relative to an anchor timestamp.16941695  - `anchor: "created_at"`16961697    Base timestamp used to calculate expiration. Currently fixed to `created_at`.16981699    - `"created_at"`17001701  - `seconds: number`17021703    Number of seconds after the anchor when the session expires.17041705### Chat Session File Upload17061707- `ChatSessionFileUpload object { enabled, max_file_size, max_files }`17081709  Upload permissions and limits applied to the session.17101711  - `enabled: boolean`17121713    Indicates if uploads are enabled for the session.17141715  - `max_file_size: number or null`17161717    Maximum upload size in megabytes.17181719  - `max_files: number or null`17201721    Maximum number of uploads allowed during the session.17221723### Chat Session History17241725- `ChatSessionHistory object { enabled, recent_threads }`17261727  History retention preferences returned for the session.17281729  - `enabled: boolean`17301731    Indicates if chat history is persisted for the session.17321733  - `recent_threads: number or null`17341735    Number of prior threads surfaced in history views. Defaults to null when all history is retained.17361737### Chat Session Rate Limits17381739- `ChatSessionRateLimits object { max_requests_per_1_minute }`17401741  Active per-minute request limit for the session.17421743  - `max_requests_per_1_minute: number`17441745    Maximum allowed requests per one-minute window.17461747### Chat Session Rate Limits Param17481749- `ChatSessionRateLimitsParam object { max_requests_per_1_minute }`17501751  Controls request rate limits for the session.17521753  - `max_requests_per_1_minute: optional number`17541755    Maximum number of requests allowed per minute for the session. Defaults to 10.17561757### Chat Session Status17581759- `ChatSessionStatus = "active" or "expired" or "cancelled"`17601761  - `"active"`17621763  - `"expired"`17641765  - `"cancelled"`17661767### Chat Session Workflow Param17681769- `ChatSessionWorkflowParam object { id, state_variables, tracing, version }`17701771  Workflow reference and overrides applied to the chat session.17721773  - `id: string`17741775    Identifier for the workflow invoked by the session.17761777  - `state_variables: optional map[string or boolean or number]`17781779    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.17801781    - `string`17821783    - `boolean`17841785    - `number`17861787  - `tracing: optional object { enabled }`17881789    Optional tracing overrides for the workflow invocation. When omitted, tracing is enabled by default.17901791    - `enabled: optional boolean`17921793      Whether tracing is enabled during the session. Defaults to true.17941795  - `version: optional string`17961797    Specific workflow version to run. Defaults to the latest deployed version.17981799### ChatKit Attachment18001801- `ChatKitAttachment object { id, mime_type, name, 2 more }`18021803  Attachment metadata included on thread items.18041805  - `id: string`18061807    Identifier for the attachment.18081809  - `mime_type: string`18101811    MIME type of the attachment.18121813  - `name: string`18141815    Original display name for the attachment.18161817  - `preview_url: string or null`18181819    Preview URL for rendering the attachment inline.18201821  - `type: "image" or "file"`18221823    Attachment discriminator.18241825    - `"image"`18261827    - `"file"`18281829### ChatKit Response Output Text18301831- `ChatKitResponseOutputText object { annotations, text, type }`18321833  Assistant response text accompanied by optional annotations.18341835  - `annotations: array of object { source, type }  or object { source, type }`18361837    Ordered list of annotations attached to the response text.18381839    - `File object { source, type }`18401841      Annotation that references an uploaded file.18421843      - `source: object { filename, type }`18441845        File attachment referenced by the annotation.18461847        - `filename: string`18481849          Filename referenced by the annotation.18501851        - `type: "file"`18521853          Type discriminator that is always `file`.18541855          - `"file"`18561857      - `type: "file"`18581859        Type discriminator that is always `file` for this annotation.18601861        - `"file"`18621863    - `URL object { source, type }`18641865      Annotation that references a URL.18661867      - `source: object { type, url }`18681869        URL referenced by the annotation.18701871        - `type: "url"`18721873          Type discriminator that is always `url`.18741875          - `"url"`18761877        - `url: string`18781879          URL referenced by the annotation.18801881      - `type: "url"`18821883        Type discriminator that is always `url` for this annotation.18841885        - `"url"`18861887  - `text: string`18881889    Assistant generated text.18901891  - `type: "output_text"`18921893    Type discriminator that is always `output_text`.18941895    - `"output_text"`18961897### ChatKit Thread18981899- `ChatKitThread object { id, created_at, object, 3 more }`19001901  Represents a ChatKit thread and its current status.19021903  - `id: string`19041905    Identifier of the thread.19061907  - `created_at: number`19081909    Unix timestamp (in seconds) for when the thread was created.19101911  - `object: "chatkit.thread"`19121913    Type discriminator that is always `chatkit.thread`.19141915    - `"chatkit.thread"`19161917  - `status: object { type }  or object { reason, type }  or object { reason, type }`19181919    Current status for the thread. Defaults to `active` for newly created threads.19201921    - `Active object { type }`19221923      Indicates that a thread is active.19241925      - `type: "active"`19261927        Status discriminator that is always `active`.19281929        - `"active"`19301931    - `Locked object { reason, type }`19321933      Indicates that a thread is locked and cannot accept new input.19341935      - `reason: string or null`19361937        Reason that the thread was locked. Defaults to null when no reason is recorded.19381939      - `type: "locked"`19401941        Status discriminator that is always `locked`.19421943        - `"locked"`19441945    - `Closed object { reason, type }`19461947      Indicates that a thread has been closed.19481949      - `reason: string or null`19501951        Reason that the thread was closed. Defaults to null when no reason is recorded.19521953      - `type: "closed"`19541955        Status discriminator that is always `closed`.19561957        - `"closed"`19581959  - `title: string or null`19601961    Optional human-readable title for the thread. Defaults to null when no title has been generated.19621963  - `user: string`19641965    Free-form string that identifies your end user who owns the thread.19661967### ChatKit Thread Assistant Message Item19681969- `ChatKitThreadAssistantMessageItem object { id, content, created_at, 3 more }`19701971  Assistant-authored message within a thread.19721973  - `id: string`19741975    Identifier of the thread item.19761977  - `content: array of ChatKitResponseOutputText`19781979    Ordered assistant response segments.19801981    - `annotations: array of object { source, type }  or object { source, type }`19821983      Ordered list of annotations attached to the response text.19841985      - `File object { source, type }`19861987        Annotation that references an uploaded file.19881989        - `source: object { filename, type }`19901991          File attachment referenced by the annotation.19921993          - `filename: string`19941995            Filename referenced by the annotation.19961997          - `type: "file"`19981999            Type discriminator that is always `file`.20002001            - `"file"`20022003        - `type: "file"`20042005          Type discriminator that is always `file` for this annotation.20062007          - `"file"`20082009      - `URL object { source, type }`20102011        Annotation that references a URL.20122013        - `source: object { type, url }`20142015          URL referenced by the annotation.20162017          - `type: "url"`20182019            Type discriminator that is always `url`.20202021            - `"url"`20222023          - `url: string`20242025            URL referenced by the annotation.20262027        - `type: "url"`20282029          Type discriminator that is always `url` for this annotation.20302031          - `"url"`20322033    - `text: string`20342035      Assistant generated text.20362037    - `type: "output_text"`20382039      Type discriminator that is always `output_text`.20402041      - `"output_text"`20422043  - `created_at: number`20442045    Unix timestamp (in seconds) for when the item was created.20462047  - `object: "chatkit.thread_item"`20482049    Type discriminator that is always `chatkit.thread_item`.20502051    - `"chatkit.thread_item"`20522053  - `thread_id: string`20542055    Identifier of the parent thread.20562057  - `type: "chatkit.assistant_message"`20582059    Type discriminator that is always `chatkit.assistant_message`.20602061    - `"chatkit.assistant_message"`20622063### ChatKit Thread Item List20642065- `ChatKitThreadItemList object { data, first_id, has_more, 2 more }`20662067  A paginated list of thread items rendered for the ChatKit API.20682069  - `data: array of ChatKitThreadUserMessageItem or ChatKitThreadAssistantMessageItem or ChatKitWidgetItem or 3 more`20702071    A list of items20722073    - `ChatKitThreadUserMessageItem object { id, attachments, content, 5 more }`20742075      User-authored messages within a thread.20762077      - `id: string`20782079        Identifier of the thread item.20802081      - `attachments: array of ChatKitAttachment`20822083        Attachments associated with the user message. Defaults to an empty list.20842085        - `id: string`20862087          Identifier for the attachment.20882089        - `mime_type: string`20902091          MIME type of the attachment.20922093        - `name: string`20942095          Original display name for the attachment.20962097        - `preview_url: string or null`20982099          Preview URL for rendering the attachment inline.21002101        - `type: "image" or "file"`21022103          Attachment discriminator.21042105          - `"image"`21062107          - `"file"`21082109      - `content: array of object { text, type }  or object { text, type }`21102111        Ordered content elements supplied by the user.21122113        - `InputText object { text, type }`21142115          Text block that a user contributed to the thread.21162117          - `text: string`21182119            Plain-text content supplied by the user.21202121          - `type: "input_text"`21222123            Type discriminator that is always `input_text`.21242125            - `"input_text"`21262127        - `QuotedText object { text, type }`21282129          Quoted snippet that the user referenced in their message.21302131          - `text: string`21322133            Quoted text content.21342135          - `type: "quoted_text"`21362137            Type discriminator that is always `quoted_text`.21382139            - `"quoted_text"`21402141      - `created_at: number`21422143        Unix timestamp (in seconds) for when the item was created.21442145      - `inference_options: object { model, tool_choice }  or null`21462147        Inference overrides applied to the message. Defaults to null when unset.21482149        - `model: string or null`21502151          Model name that generated the response. Defaults to null when using the session default.21522153        - `tool_choice: object { id }  or null`21542155          Preferred tool to invoke. Defaults to null when ChatKit should auto-select.21562157          - `id: string`21582159            Identifier of the requested tool.21602161      - `object: "chatkit.thread_item"`21622163        Type discriminator that is always `chatkit.thread_item`.21642165        - `"chatkit.thread_item"`21662167      - `thread_id: string`21682169        Identifier of the parent thread.21702171      - `type: "chatkit.user_message"`21722173        - `"chatkit.user_message"`21742175    - `ChatKitThreadAssistantMessageItem object { id, content, created_at, 3 more }`21762177      Assistant-authored message within a thread.21782179      - `id: string`21802181        Identifier of the thread item.21822183      - `content: array of ChatKitResponseOutputText`21842185        Ordered assistant response segments.21862187        - `annotations: array of object { source, type }  or object { source, type }`21882189          Ordered list of annotations attached to the response text.21902191          - `File object { source, type }`21922193            Annotation that references an uploaded file.21942195            - `source: object { filename, type }`21962197              File attachment referenced by the annotation.21982199              - `filename: string`22002201                Filename referenced by the annotation.22022203              - `type: "file"`22042205                Type discriminator that is always `file`.22062207                - `"file"`22082209            - `type: "file"`22102211              Type discriminator that is always `file` for this annotation.22122213              - `"file"`22142215          - `URL object { source, type }`22162217            Annotation that references a URL.22182219            - `source: object { type, url }`22202221              URL referenced by the annotation.22222223              - `type: "url"`22242225                Type discriminator that is always `url`.22262227                - `"url"`22282229              - `url: string`22302231                URL referenced by the annotation.22322233            - `type: "url"`22342235              Type discriminator that is always `url` for this annotation.22362237              - `"url"`22382239        - `text: string`22402241          Assistant generated text.22422243        - `type: "output_text"`22442245          Type discriminator that is always `output_text`.22462247          - `"output_text"`22482249      - `created_at: number`22502251        Unix timestamp (in seconds) for when the item was created.22522253      - `object: "chatkit.thread_item"`22542255        Type discriminator that is always `chatkit.thread_item`.22562257        - `"chatkit.thread_item"`22582259      - `thread_id: string`22602261        Identifier of the parent thread.22622263      - `type: "chatkit.assistant_message"`22642265        Type discriminator that is always `chatkit.assistant_message`.22662267        - `"chatkit.assistant_message"`22682269    - `ChatKitWidgetItem object { id, created_at, object, 3 more }`22702271      Thread item that renders a widget payload.22722273      - `id: string`22742275        Identifier of the thread item.22762277      - `created_at: number`22782279        Unix timestamp (in seconds) for when the item was created.22802281      - `object: "chatkit.thread_item"`22822283        Type discriminator that is always `chatkit.thread_item`.22842285        - `"chatkit.thread_item"`22862287      - `thread_id: string`22882289        Identifier of the parent thread.22902291      - `type: "chatkit.widget"`22922293        Type discriminator that is always `chatkit.widget`.22942295        - `"chatkit.widget"`22962297      - `widget: string`22982299        Serialized widget payload rendered in the UI.23002301    - `ChatKitClientToolCall object { id, arguments, call_id, 7 more }`23022303      Record of a client side tool invocation initiated by the assistant.23042305      - `id: string`23062307        Identifier of the thread item.23082309      - `arguments: string`23102311        JSON-encoded arguments that were sent to the tool.23122313      - `call_id: string`23142315        Identifier for the client tool call.23162317      - `created_at: number`23182319        Unix timestamp (in seconds) for when the item was created.23202321      - `name: string`23222323        Tool name that was invoked.23242325      - `object: "chatkit.thread_item"`23262327        Type discriminator that is always `chatkit.thread_item`.23282329        - `"chatkit.thread_item"`23302331      - `output: string or null`23322333        JSON-encoded output captured from the tool. Defaults to null while execution is in progress.23342335      - `status: "in_progress" or "completed"`23362337        Execution status for the tool call.23382339        - `"in_progress"`23402341        - `"completed"`23422343      - `thread_id: string`23442345        Identifier of the parent thread.23462347      - `type: "chatkit.client_tool_call"`23482349        Type discriminator that is always `chatkit.client_tool_call`.23502351        - `"chatkit.client_tool_call"`23522353    - `ChatKitTask object { id, created_at, heading, 5 more }`23542355      Task emitted by the workflow to show progress and status updates.23562357      - `id: string`23582359        Identifier of the thread item.23602361      - `created_at: number`23622363        Unix timestamp (in seconds) for when the item was created.23642365      - `heading: string or null`23662367        Optional heading for the task. Defaults to null when not provided.23682369      - `object: "chatkit.thread_item"`23702371        Type discriminator that is always `chatkit.thread_item`.23722373        - `"chatkit.thread_item"`23742375      - `summary: string or null`23762377        Optional summary that describes the task. Defaults to null when omitted.23782379      - `task_type: "custom" or "thought"`23802381        Subtype for the task.23822383        - `"custom"`23842385        - `"thought"`23862387      - `thread_id: string`23882389        Identifier of the parent thread.23902391      - `type: "chatkit.task"`23922393        Type discriminator that is always `chatkit.task`.23942395        - `"chatkit.task"`23962397    - `ChatKitTaskGroup object { id, created_at, object, 3 more }`23982399      Collection of workflow tasks grouped together in the thread.24002401      - `id: string`24022403        Identifier of the thread item.24042405      - `created_at: number`24062407        Unix timestamp (in seconds) for when the item was created.24082409      - `object: "chatkit.thread_item"`24102411        Type discriminator that is always `chatkit.thread_item`.24122413        - `"chatkit.thread_item"`24142415      - `tasks: array of object { heading, summary, type }`24162417        Tasks included in the group.24182419        - `heading: string or null`24202421          Optional heading for the grouped task. Defaults to null when not provided.24222423        - `summary: string or null`24242425          Optional summary that describes the grouped task. Defaults to null when omitted.24262427        - `type: "custom" or "thought"`24282429          Subtype for the grouped task.24302431          - `"custom"`24322433          - `"thought"`24342435      - `thread_id: string`24362437        Identifier of the parent thread.24382439      - `type: "chatkit.task_group"`24402441        Type discriminator that is always `chatkit.task_group`.24422443        - `"chatkit.task_group"`24442445  - `first_id: string or null`24462447    The ID of the first item in the list.24482449  - `has_more: boolean`24502451    Whether there are more items available.24522453  - `last_id: string or null`24542455    The ID of the last item in the list.24562457  - `object: "list"`24582459    The type of object returned, must be `list`.24602461    - `"list"`24622463### ChatKit Thread User Message Item24642465- `ChatKitThreadUserMessageItem object { id, attachments, content, 5 more }`24662467  User-authored messages within a thread.24682469  - `id: string`24702471    Identifier of the thread item.24722473  - `attachments: array of ChatKitAttachment`24742475    Attachments associated with the user message. Defaults to an empty list.24762477    - `id: string`24782479      Identifier for the attachment.24802481    - `mime_type: string`24822483      MIME type of the attachment.24842485    - `name: string`24862487      Original display name for the attachment.24882489    - `preview_url: string or null`24902491      Preview URL for rendering the attachment inline.24922493    - `type: "image" or "file"`24942495      Attachment discriminator.24962497      - `"image"`24982499      - `"file"`25002501  - `content: array of object { text, type }  or object { text, type }`25022503    Ordered content elements supplied by the user.25042505    - `InputText object { text, type }`25062507      Text block that a user contributed to the thread.25082509      - `text: string`25102511        Plain-text content supplied by the user.25122513      - `type: "input_text"`25142515        Type discriminator that is always `input_text`.25162517        - `"input_text"`25182519    - `QuotedText object { text, type }`25202521      Quoted snippet that the user referenced in their message.25222523      - `text: string`25242525        Quoted text content.25262527      - `type: "quoted_text"`25282529        Type discriminator that is always `quoted_text`.25302531        - `"quoted_text"`25322533  - `created_at: number`25342535    Unix timestamp (in seconds) for when the item was created.25362537  - `inference_options: object { model, tool_choice }  or null`25382539    Inference overrides applied to the message. Defaults to null when unset.25402541    - `model: string or null`25422543      Model name that generated the response. Defaults to null when using the session default.25442545    - `tool_choice: object { id }  or null`25462547      Preferred tool to invoke. Defaults to null when ChatKit should auto-select.25482549      - `id: string`25502551        Identifier of the requested tool.25522553  - `object: "chatkit.thread_item"`25542555    Type discriminator that is always `chatkit.thread_item`.25562557    - `"chatkit.thread_item"`25582559  - `thread_id: string`25602561    Identifier of the parent thread.25622563  - `type: "chatkit.user_message"`25642565    - `"chatkit.user_message"`25662567### ChatKit Widget Item25682569- `ChatKitWidgetItem object { id, created_at, object, 3 more }`25702571  Thread item that renders a widget payload.25722573  - `id: string`25742575    Identifier of the thread item.25762577  - `created_at: number`25782579    Unix timestamp (in seconds) for when the item was created.25802581  - `object: "chatkit.thread_item"`25822583    Type discriminator that is always `chatkit.thread_item`.25842585    - `"chatkit.thread_item"`25862587  - `thread_id: string`25882589    Identifier of the parent thread.25902591  - `type: "chatkit.widget"`25922593    Type discriminator that is always `chatkit.widget`.25942595    - `"chatkit.widget"`25962597  - `widget: string`25982599    Serialized widget payload rendered in the UI.26002601### Thread Delete Response26022603- `ThreadDeleteResponse object { id, deleted, object }`26042605  Confirmation payload returned after deleting a thread.26062607  - `id: string`26082609    Identifier of the deleted thread.26102611  - `deleted: boolean`26122613    Indicates that the thread has been deleted.26142615  - `object: "chatkit.thread.deleted"`26162617    Type discriminator that is always `chatkit.thread.deleted`.26182619    - `"chatkit.thread.deleted"`2620
Files main
Menu

Theme