Skip to main content
POST
Use orq.router.decisions.create() in the Node and Python SDKs.
Related guide: See the Decisions guide for examples, fallbacks, timeouts, retries, caching, and identity attribution. The request requires the classify API-key permission.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
string
required

ID of a model that supports native or emulated classify, including openai/gpt-6-luna.

questions
object
required

Typed questions keyed by an identifier of your choice. Each answer is returned under the same key. Native OpenAI accepts 1 to 400 questions.

state
required

The content to evaluate. A string, an object or an array. For TypeSafe models, reference images declared in assets by writing their reference string. Native OpenAI accepts messages and function/custom-tool history. User messages support input_text, input_image and input_json; images can use inline base64 data URLs or public HTTP(S) URLs. At most 128 images across state and question instructions. Shared text/image parts support explicit prompt_cache_breakpoint markers. File IDs, audio, item references and bare content parts are unsupported. Other objects and arrays are serialized as text.

assets
object

Beta, TypeSafe models only. Inline images keyed by a reference string. Write the reference in state, instructions or criteria wherever the image belongs; every asset must be referenced. Required for box questions.

cache
object

Exact-match response cache for this request. An identical request body from the same workspace and project is served from the stored response, with the X-Cache header reporting HIT or MISS.

fallback_on_codes
integer<int64>[] | null

HTTP status codes that trigger fallback. Defaults to [408,429,500,502,503,504,529]. Each code must be unique and between 400 and 599.

Maximum array length: 20
fallbacks
object[] | null

Up to 10 fallback models in order. The gateway retries a model for matching error codes before trying the next model. Every model must support classification and satisfy access checks. Requests with images in state require native OpenAI image-capable fallbacks; requests with assets or box questions require TypeSafe fallbacks.

Maximum array length: 10
identity
object

The identity to attach to the trace.

metadata
object

Key-value metadata attached to the trace.

name
string

The name to display on the trace. If not specified, the default system name will be used.

prompt_cache_key
string

Native OpenAI only. Partitions reuse of shared input across requests.

Maximum string length: 64
prompt_cache_options
object

Native OpenAI prompt caching controls. Separate from the gateway exact-match response cache.

retry
object

Retry configuration for the request.

timeout
object

Timeout for each model call, including every retry and fallback. A timed-out call returns 408 and advances to the next fallback after configured retries are exhausted.

Response

Returns one answer per question.

answers
object
required

Answers keyed by the question identifiers from the request.

model
string
required

The requested ID of the model that answered. This can be a fallback model.

usage
object
required

The usage information for the request.

telemetry
object

OpenTelemetry trace and span identifiers for this request.