Ingest batched interview token-delta frames
Used by the interview runner to relay streamed assistant token deltas to the browser. Frames are batched (≤100ms or 20 tokens per flush) and published to `interviewTokenChannel(interviewId)` via Redis pub/sub, where `GET /api/interview/[id]/stream` picks them up for SSE re-delivery to the browser. Auth mirrors `/api/sessions/{id}/activity` (worker runtime JWT).
Authorization
workerJwt Runtime JWT minted by the platform at worker registration. Three-segment dotted string. Claims include {jti, proj, org, sub (=workerId), reg, scope[]}. Use on all post-registration worker endpoints.
In: header
Path Parameters
Session ID (interview is resolved server-side from interviews.session_id).
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/sessions/string/token-delta" \ -H "Content-Type: application/json" \ -d '{ "turnId": "string", "frames": [ {} ] }'{
"published": 0
}{
"error": "Session not found"
}{
"error": "Session not found"
}{
"error": "Session not found"
}{
"error": "Session not found"
}Sample MAB router for provider selection
Called by the cloud runner at session start to ask the platform's multi-armed bandit router which provider to use. The platform reads Beta-distribution posteriors and runs Thompson sampling over the caller-supplied candidates list. Returns `null` provider with a `source` reason on all error / disabled / explicit-override paths (HTTP 200 always) so the runner can always fall back to its statically resolved provider. Kill-switch: `ROUTING_SELECTOR_ENABLED` env must be exactly `"true"`; default is DARK. Explicit dispatch overrides always return `{ selectedProvider: null, source: 'explicit' }`.
Resolve credential env map for a session
Called by the host daemon at session spawn to obtain the merged environment variable map for the agent. The `orgId` in the body must match the authenticated org (cross-tenant guard). Audit event emitted asynchronously (does not include secret values).