Ephemeral AI Sessions
POST/v1/ai/{project_id}/session
Eliminates API key exposure on mobile and SPA frontends by issuing bounded capability tokens.
Mint headers and body#
| Header | Required | Value |
|---|---|---|
apikey | yes | Service role key or authenticated user JWT |
Content-Type | yes | application/json |
The minting endpoint checks and reserves token budgets against the project's real monthly quota and caches the resolved provider pipeline for 300 seconds.
Strict capability authentication#
Attention
Endpoints /session/chat, /session/chat/stream, and /session/embed strictly mandate Authorization: Bearer <ticket>. Supplying standard apikey headers is rejected to prevent confusion between permanent keys and ephemeral session capabilities.