Skip to main content
A session is a time-bounded payment context linked to a Compose Key. It tracks how much you’ve spent and how much remains. The SDK monitors the budget in real time via response headers.

Check session status

Set a budget limit

When creating a Compose Key, you can set a maximum spend:

Live budget tracking

Every billable response includes budget headers. The SDK parses them and emits a budget event:

Session events

Subscribe to real-time session lifecycle events via SSE:

Session invalid reasons

When a session becomes invalid, the SDK emits a sessionInvalid event: