Speko Docs
API Reference

Sessions

Creates either a provider-direct S2S session with a scoped OpenAI, Gemini Live, or xAI credential, or a cascade session with browser-safe LiveKit transport credentials.

POST
/v1/sessions

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Header Parameters

Idempotency-Key?string

Required when the session resolves to s2s. Reuse the same value after an ambiguous timeout to recover the same reservation.

Lengthlength <= 256

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

{
  "mode": "cascade",
  "sessionId": "f6567dd8-e069-418e-8893-7d22fcf12459",
  "transportToken": "string",
  "transportUrl": "http://example.com",
  "conversationToken": "string",
  "livekitUrl": "http://example.com",
  "roomName": "speko_...",
  "identity": "string",
  "expiresAt": "2019-08-24T14:15:22Z"
}
{
  "error": "Invalid request body",
  "code": "VALIDATION_ERROR"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
Empty
Empty
Empty
Empty
Empty
{
  "error": "Failed to dispatch voice agent",
  "code": "SESSION_CREATE_FAILED"
}
Empty
Empty