Skip to content
OpenRelay is in early access, and the /v1 API is stable. New capabilities ship in the changelog.
API ReferenceInferenceDecisions

Answer typed questions with a classifier

Answers typed questions about a text or JSON input with a classifier: a choice, a score or a yes/no, with probabilities. Bills input tokens only. Each answer carries its probabilities and a confidence; nothing is generated. Served by openrelay/laya; check a model's supported_apis on GET /v1/models for decisions. Online only: the Batch API does not accept /v1/decisions. Requires a funded balance. Any field this schema does not list is rejected with 400 unknown_field. stream is dropped: a decision is always a single JSON response. Limits: 1 to 64 questions per request, 10 MiB request body.

Required permission

Requires the inference.invoke permission. See Permissions for the roles and API key permissions that include it.

Command line

The orl CLI wraps this endpoint:

orl decisions create --model <model> --questions <questions> --state <state>
POST
/v1/decisions

Authorization

apiKey
headerAuthorizationBearer <token>

OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).

Request Body

application/json
  1. body

A typed-decision request: a state to decide about and a set of questions, each answered as a label or a score. stream is dropped; a decision is always a single JSON response. Any field this schema does not list is rejected by the gateway with 400 unknown_field.

model*string

openrelay/laya.

state*||array<unknown>

The input to decide about. Objects and arrays are serialized to JSON text before the model reads them.

questions*

Question id to question ({type, instructions, criteria}). Between 1 and 64 questions.

[key: string]?any

Response Body

OK

application/json
  1. response

A decisions response (opaque; additionalProperties carries the rest of the dialect).

model?string

The public model id requested.

answers?
routing?
usage?
openrelay?

What the request is billed, on every online inference response.

[key: string]?any
Example Request
curl -X POST 'https://inference.openrelay.inc/v1/decisions' \  -H 'Content-Type: application/json' \  -d '{  "model": "string",  "state": "string",  "questions": {    "property1": {},    "property2": {}  }}'
Example Response
{  "model": "string",  "answers": {    "property1": {},    "property2": {}  },  "routing": {},  "usage": {},  "openrelay": {    "cost_nano_usd": 0,    "priced_at": "string"  }}