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' }`.
Short-lived worker runtime JWT minted by the platform. Claims bind the worker, project, organization, registration, and scopes.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/sessions/string/routing-select" \ -H "Content-Type: application/json" \ -d '{ "workType": "string", "candidates": [ "string" ] }'{
"selectedProvider": "string",
"source": "disabled",
"expectedReward": 0,
"confidence": 0
}{
"error": "Session not found"
}{
"error": "Session not found"
}{
"error": "Session not found"
}Record a routing observation (MAB reward)
Called by the runner at session end to report the outcome of a provider dispatch. Updates the Beta-distribution posterior for the `(provider, workType)` arm in the multi-armed bandit router and appends an observation entry. Best-effort: store errors return `{ recorded: false }` with HTTP 200 so a Redis blip never fails the worker's terminal flow.
Post security scan event
Post security scan event - Rensei REST API operation reference.