Skip to content

Change how calls are routed

PATCH
/v1/models/{model}/routing
curl --request PATCH \
--url https://api.pensievelabs.co/v1/models/grade-audit/routing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "mode": "model", "threshold": 0.8 }'

observe records calls only: your own code keeps answering, through capture. model sends calls to the expert model and falls back under threshold. split sends split_percent of calls to the model and the rest to your code.

model
required
string

The model’s slug, such as grade-audit, or its mdl_ id.

Example

grade-audit
Media typeapplication/json
object
mode
string
Allowed values: observe model split
threshold
number
<= 1
split_percent
integer
<= 100

Example

{
"mode": "model",
"threshold": 0.8
}

The routing now in force.

Media typeapplication/json
object
object
required
Allowed value: routing
model
required
string
mode
required
string
Allowed values: observe model split
threshold
required

Under this confidence a call falls back.

number
<= 1
split_percent
required
integer | null
<= 100
updated_at
required
string format: date-time

Example

{
"object": "routing",
"mode": "observe"
}

Something went wrong; error.type says what.

Media typeapplication/json
object
error
required
object
type
required
string
Allowed values: invalid_request authentication permission not_found conflict rate_limit not_available server
message
required
string
param

The request field the error is about.

string | null
request_id
required
string

Example

{
"error": {
"type": "invalid_request"
}
}