Create a new session. See Sessions.
API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....
Session creation input. For non-production sessions, testCaseId is required and context is not allowed. For production sessions (isProduction=true), testCaseId must be omitted and context is allowed.
Version ID to create the session for
"ver_123"
Test case to link this session to. Required for non-production sessions.
"tc_123"
Optional caller-defined identifier for the session
"my-session-1"
When false (default), creates a non-production session linked to a test case.
false Arbitrary key-value metadata
{ "key": "value" }Initial session status
PENDING, COMPLETED, FAILED Session created successfully
"session_123"
"custom_session_123"
"ver_123"
"user_123"
"tc_123"
Structured context data. For plain text context, format is { value: "..." }
{ "value": "Session context information" }"GOAL_ACHIEVED"
"External API responded with HTTP 422: Unprocessable Entity — {\"detail\":\"model not found\"}"
PENDING, COMPLETED, FAILED "PENDING"
{ "key": "value" }