NylorunDocsBeta
Runtime APISessions

Choose a session's model

PUT
/v1/sessions/{sessionId}/model

Chooses one of a connected provider's models for the session's turns (feature session-model), in place of the Tenant's model. The Tenant's model and every other session's stay as they are. Only the application sets it, for itself or for a subject: a trusted issuer's token is refused. A turn calls one model, so the choice changes only while no turn runs or waits (409 session_busy). A provider that is not connected, or a model its catalog does not list, is 422 request_rejected.

Authorization

applicationKey
headerAuthorizationBearer <token>

An application key of the Tenant (PUT /v1/tenant/keys/{keyId}), or Studio's key, derived from the admin key. With Nylorun-Subject and Nylorun-Scopes, it acts for that person, narrowed to those scopes. Never accepted from a browser (Origin).

Path Parameters

sessionId*string

Header Parameters

Nylorun-Protocol*string

The protocol version, 18

Nylorun-Subject?string

The person an application key acts for

Nylorun-Scopes?string

The subject's space-separated scopes; required with a subject

Request Body

application/json
  1. body
provider*string
Length1 <= length
model*string
Length1 <= length

Response Body

The session's model

application/json
  1. response
configured*false
Value infalse
choice?
curl -X PUT "https://example.com/v1/sessions/string/model" \  -H "Nylorun-Protocol: string" \  -H "Content-Type: application/json" \  -d '{    "provider": "string",    "model": "string"  }'
{  "configured": false,  "choice": {    "provider": "string",    "model": "string"  }}