NAME
OpenAPI::Client::OpenAI::Path::chatkit-sessions - Documentation for the /chatkit/sessions path.
OPERATIONS
POST /chatkit/sessions
CreateChatSessionMethod
$client->create_chat_session_method({
body => { ... },
});
Create a ChatKit session.
Responses
200 - Success
Content-Type: application/json
Example:
{
"chatkit_configuration" : {
"automatic_thread_titling" : {
"enabled" : true
},
"file_upload" : {
"enabled" : true,
"max_file_size" : 16,
"max_files" : 20
},
"history" : {
"enabled" : true,
"recent_threads" : 10
}
},
"client_secret" : "ek_token_123",
"expires_at" : 1712349876,
"id" : "cksess_123",
"max_requests_per_1_minute" : 60,
"object" : "chatkit.session",
"rate_limits" : {
"max_requests_per_1_minute" : 60
},
"status" : "cancelled",
"user" : "user_789",
"workflow" : {
"id" : "workflow_alpha",
"version" : "2024-10-01T00:00:00.000Z"
}
}
SCHEMAS
AutomaticThreadTitlingParam
Properties:
enabled(boolean) - Enable automatic thread title generation. Defaults to true.
ChatSessionAutomaticThreadTitling
Properties:
enabled(boolean, required) - Whether automatic thread titling is enabled.
ChatSessionChatkitConfiguration
Properties:
automatic_thread_titling(ChatSessionAutomaticThreadTitling, required) - Automatic thread titling preferences.See "ChatSessionAutomaticThreadTitling" below for shape.
file_upload(ChatSessionFileUpload, required) - Upload settings for the session.See "ChatSessionFileUpload" below for shape.
history(ChatSessionHistory, required) - History retention configuration.See "ChatSessionHistory" below for shape.
ChatSessionFileUpload
Properties:
enabled(boolean, required) - Indicates if uploads are enabled for the session.max_file_size(anyOf, required)max_files(anyOf, required)
ChatSessionHistory
Properties:
enabled(boolean, required) - Indicates if chat history is persisted for the session.recent_threads(anyOf, required)
ChatSessionRateLimits
Properties:
max_requests_per_1_minute(integer, required) - Maximum allowed requests per one-minute window.
ChatSessionResource
Properties:
chatkit_configuration(ChatSessionChatkitConfiguration, required) - Resolved ChatKit feature configuration for the session.See "ChatSessionChatkitConfiguration" below for shape.
client_secret(string, required) - Ephemeral client secret that authenticates session requests.expires_at(integer, required) - Unix timestamp (in seconds) for when the session expires.id(string, required) - Identifier for the ChatKit session.max_requests_per_1_minute(integer, required) - Convenience copy of the per-minute request limit.object(string, required) - Type discriminator that is alwayschatkit.session.Allowed values: chatkit.session
Default: chatkit.session
rate_limits(ChatSessionRateLimits, required) - Resolved rate limit values.See "ChatSessionRateLimits" below for shape.
status(ChatSessionStatus, required) - Current lifecycle state of the session.See "ChatSessionStatus" below for shape.
user(string, required) - User identifier associated with the session.workflow(ChatkitWorkflow, required) - Workflow metadata for the session.See "ChatkitWorkflow" below for shape.
ChatSessionStatus
See https://platform.openai.com/docs/api-reference for details.
ChatkitConfigurationParam
Properties:
automatic_thread_titling(AutomaticThreadTitlingParam) - Configuration for automatic thread titling. When omitted, automatic thread titling is enabled by default.See "AutomaticThreadTitlingParam" below for shape.
file_upload(FileUploadParam) - Configuration for upload enablement and limits. When omitted, uploads are disabled by default (max_files 10, max_file_size 512 MB).See "FileUploadParam" below for shape.
history(HistoryParam) - Configuration for chat history retention. When omitted, history is enabled by default with no limit on recent_threads (null).See "HistoryParam" below for shape.
ChatkitWorkflow
Properties:
id(string, required) - Identifier of the workflow backing the session.state_variables(anyOf, required)tracing(ChatkitWorkflowTracing, required) - Tracing settings applied to the workflow.See "ChatkitWorkflowTracing" below for shape.
version(anyOf, required)
ChatkitWorkflowTracing
Properties:
enabled(boolean, required) - Indicates whether tracing is enabled.
CreateChatSessionBody
Properties:
chatkit_configuration(ChatkitConfigurationParam) - Optional overrides for ChatKit runtime configuration featuresSee "ChatkitConfigurationParam" below for shape.
expires_after(ExpiresAfterParam) - Optional override for session expiration timing in seconds from creation. Defaults to 10 minutes.See "ExpiresAfterParam" below for shape.
rate_limits(RateLimitsParam) - Optional override for per-minute request limits. When omitted, defaults to 10.See "RateLimitsParam" below for shape.
user(string, required) - A free-form string that identifies your end user; ensures this Session can access other objects that have the sameuserscope.workflow(WorkflowParam, required) - Workflow that powers the session.See "WorkflowParam" below for shape.
ExpiresAfterParam
Properties:
anchor(string, required) - Base timestamp used to calculate expiration. Currently fixed tocreated_at.Allowed values: created_at
Default: created_at
seconds(integer, required) - Number of seconds after the anchor when the session expires.
FileUploadParam
Properties:
enabled(boolean) - Enable uploads for this session. Defaults to false.max_file_size(integer) - Maximum size in megabytes for each uploaded file. Defaults to 512 MB, which is the maximum allowable size.max_files(integer) - Maximum number of files that can be uploaded to the session. Defaults to 10.
HistoryParam
Properties:
enabled(boolean) - Enables chat users to access previous ChatKit threads. Defaults to true.recent_threads(integer) - Number of recent ChatKit threads users have access to. Defaults to unlimited when unset.
RateLimitsParam
Properties:
max_requests_per_1_minute(integer) - Maximum number of requests allowed per minute for the session. Defaults to 10.
WorkflowParam
Properties:
id(string, required) - Identifier for the workflow invoked by the session.state_variables(object) - 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.tracing(WorkflowTracingParam) - Optional tracing overrides for the workflow invocation. When omitted, tracing is enabled by default.See "WorkflowTracingParam" below for shape.
version(string) - Specific workflow version to run. Defaults to the latest deployed version.
WorkflowTracingParam
Properties:
enabled(boolean) - Whether tracing is enabled during the session. Defaults to true.
SEE ALSO
COPYRIGHT AND LICENSE
Copyright (C) 2023-2026 by Nelson Ferraz
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.0 or, at your option, any later version of Perl 5 you may have available.