Session Operations
Create Session
Initialize a new conversation session
POST
Authorization
string
required
Bearer token. Format:
Bearer synthra_live_abc123def456Body Parameters
string
required
Unique identifier for the user. Format:
user_<16 chars>object
Optional metadata to attach to the session.Example:
{ "source": "web", "language": "en" }object
Context window configuration.Properties:
maxTokens(number): Maximum context window size. Default: 4096compressionEnabled(boolean): Enable automatic compression. Default: trueretentionPolicy(string): Strategy for message retention. Options:fifo,priority,semantic
Response
string
Unique session identifier. Format:
session_<16 chars>string
User identifier associated with this session
string
ISO 8601 timestamp of session creation
string
ISO 8601 timestamp when session will auto-expire (24 hours)
number
Current number of messages in session. Initially 0.
object
Token usage statisticsProperties:
total(number): Total tokens usedprompt(number): Tokens in promptscompletion(number): Tokens in completions