no_route_available and want to know why.
Decision or verdict
Because
kind defaults to "verdict", a decision request that forgets "kind": "decision" is treated as a verdict run. It is then refused with 400 invalid_body, for example state is only valid on a decision run.
The request
The same headers as every run apply:
Authorization: Bearer $OPENTYPE_API_KEY with the runs_write scope, Content-Type: application/json, and an Idempotency-Key of 1 to 255 bytes of visible text.
Decision fields are refused on a verdict run with 400 invalid_body: state, questions, instructions, draws, think_tokens and question_order each give <field> is only valid on a decision run.
intent.json
The response
When a route can serve it, a completed verdict run returns the run fields plusverdict, the validated document. This example shows the shape, not a response you can get today:
schema_enforcement
A live verdict response says how the schema bound the answer. Every returned verdict passed validation against your schema, whatever this value is.
schema_enforcement and cost_basis appear only on the live response to POST /v1/runs. A stored copy of the run, from GET /v1/runs/{run_id}, the stream or a replayed Idempotency-Key, omits both.
Schema bounds
A schema is checked before any model call. One that breaks a bound is refused with400 invalid_verdict_schema, and nothing is charged.
The message is
the verdict schema is not acceptable: followed by the reason:
schema must be a JSON objectschema is larger than the permitted sizeschema nests deeper than permittedschema nests more subschemas than permittedschema declares more properties than permittedschema $ref must be a local pointer beginning with #schema $ref must be a stringschema $ref must point at a subschema within the same schemaschema uses a keyword whose references cannot be bounded: $id, id, $anchor, $dynamicAnchor, $dynamicRef, $recursiveAnchor, $recursiveRefschema uses an unrecognised keyword with a structured valueschema pattern is longer than permittedschema is not a valid JSON Schema
capability_hint mistakes use the same code: too many capability hints, duplicate capability hints, too many capability needs. They do so on decision runs too.
Attempts and verdict_schema_violation
A verdict run gets at most two model calls: the answer, and one repair when the answer does not pass the schema. When the second attempt still breaks the schema, or does not produce a document at all, the run fails with 503 verdict_schema_violation. The error carries violations, up to 10 JSON Pointers into the rejected document:
- Only this code carries
violations. The field is absent when the model returned no document. - The attempts that ran were model calls, so the run is settled
failedand charged what they cost. - A replay of the same
Idempotency-Keyreturns that failed run with200and"state": "failed". It does not run again. To try again, loosen the schema, or send the same body with a new key.
What goes wrong
After a
503 no_route_available, a replay with the same Idempotency-Key returns 202 with the stored run still pending. It is never picked up again, so do not poll it: send any later attempt with a new key.
Related
- Decision runs - the run kind Neon 1.1 serves today.
- Runs - run kinds, states and the fields every run returns.
- no_route_available - what the refusal means and what to do.
- invalid_verdict_schema - every reason a schema is refused.
- Limits - every per-request limit in one table.