Rensei docs
API ReferenceWorker Protocol

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).

POST
/api/sessions/{id}/token-delta

Authorization

AuthorizationBearer <token>

Short-lived worker runtime JWT minted by the platform. Claims bind the worker, project, organization, registration, and scopes.

In: header

Path Parameters

id*string

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"
}