POST /v1/evaluate answers structured questions about a piece of application state. Instead of prose you have to parse, each answer comes back typed — a chosen option with a probability for every option, a score against a scale you define, or a single probability.
An ordinary API key calls this endpoint. If you have restricted a key to a specific set of scopes, that set has to include
evaluate:write — a key with no scope restrictions already has it.How it differs from structured output
Structured output makes a chat model return JSON in a shape you specify. It is the right tool when you want the model to produce content in a fixed format. Evaluate is for decisions. You give it the options, and it returns how likely each one is — a calibrated number you can threshold, route on, or log. You never write a prompt asking for JSON, and there is nothing to parse or repair.Models
Question types
Every question declares atype, and that decides which criteria shape is legal.
Making a request
state is whatever your application looks like — a string, an object, or an array. Every question is answered against that same state.
- curl
- Python
answers.
The response
Request rules
Anything the endpoint cannot make sense of is rejected with a422 before the model is called, so you are never billed for a question that could not be answered.
Two options is the floor because a single-option choice is not a decision — the model can only pick the one you gave it, and you would pay input tokens for an answer that was never in doubt. Blank criteria are refused for the same reason: a scale with no labels produces a number with no meaning.
Fields this endpoint does not define are rejected rather than ignored, so a misspelled
criteria fails loudly instead of quietly changing the question.
Attribution and limits
Two optional fields let you attribute the request in your own usage reports. Neither is ever forwarded to the model provider.
Rate limits, spend caps, and credit balance apply exactly as they do on
/v1/chat/completions.
There is no streaming on this endpoint: an evaluation returns one small JSON body, so there is nothing to stream.