Skip to navigation

Send Routing Feedback

Say whether a request was routed well. When a custom classifier scored it and the feedback carries a prompt, the prompt is added to that classifier’s examples with the corrected complexity and the classifier rebuilds in the background. Only one feedback on a request trains. A skipped feedback keeps no prompt; resending it with the same idempotency_key and a new body corrects that row, and trains if the correction qualifies.

Authentication

AuthorizationBearer

A management key (mgmt_...), sent as Authorization: Bearer <key>. Reading /v1/routing-policies also accepts the organization’s gateway API keys; writing there needs a management key.

Request

This endpoint expects an object.
request_idstringRequired1-255 characters
The request's id.
verdictenumRequired
Whether the routed model fit the request.
Allowed values:
correct_complexitydouble or nullOptional0-1
The complexity it should have scored, 0 to 1.
directionenum or nullOptional

For bad: which way routing should have gone. Inferred when the request went to the cheapest or the strongest tier.

Allowed values:
idempotency_keystring or nullOptional1-255 characters

Retries with the same key are no-ops.

notestring or nullOptional<=2000 characters
Free text, stored with the feedback.
promptstring or nullOptional1-32000 characters

The request’s prompt (its last user message). Without it the feedback is stored but doesn’t train.

Response

A replay of stored feedback
classifier_idstring or nullformat: "uuid"
The classifier that scored the request.
idstringformat: "uuid"
labeldouble or null
The complexity label, when one could be set.
request_idstring
skip_reasonenum or null
Why it didn't train, when it didn't.
trainedboolean
Whether an example was added to the classifier.
verdictenum
Allowed values:

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error