Overview
Without sessions, you manage conversation history manually by sending all prior messages on every request. Sessions do this for you server-side, stored in Redis with a 7-day TTL.Create a session
session_id to get an auto-generated one:
Session ID format
session_id must match: ^[a-zA-Z0-9_-]{1,64}$ — alphanumeric, hyphens, and underscores, 1–64 characters.
Good session IDs: user-123, conv_abc, proj-2026-march, thread_def456
Chat with a session
Addsession_id to any /chat request. Previous messages are automatically injected before your new messages.
Chat response with session info
Retrieve a session
Export a session
Export as JSON or Markdown — useful for saving conversations, support tickets, or debugging..md file.
Delete a session
Limits and behavior
Code examples
Cache is automatically disabled when
session_id is present — since history changes every request, cached responses would be incorrect.