Create ChatKit session
POST/chatkit/sessions
Create a ChatKit session.
Body ParametersJSON
user: string
A free-form string that identifies your end user; ensures this Session can access other objects that have the same user scope.
minLength1
Returns
Create ChatKit session
curl https://api.openai.com/v1/chatkit/sessions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "OpenAI-Beta: chatkit_beta=v1" \
-d '{
"workflow": {
"id": "workflow_alpha",
"version": "2024-10-01"
},
"scope": {
"project": "alpha",
"environment": "staging"
},
"expires_after": 1800,
"max_requests_per_1_minute": 60,
"max_requests_per_session": 500
}'
{
"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"
}
Returns Examples
{
"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"
}