Decision models use the native System One protocol to answer one or more classification, scoring, or open-ended questions from structured state.

Endpoint and authentication

ItemValue
Request endpointPOST https://routerbrain.ai/decision/v1/systemone
AuthenticationAuthorization: Bearer <API-Key>
Content-Typeapplication/json
Response modeSynchronous JSON; streaming is not supported

Find model codes in the decision model catalog.

Quick example

curl -X POST https://routerbrain.ai/decision/v1/systemone \
  -H 'Authorization: Bearer sk-xxxxxxxx' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: order-review-20260930-001' \
  -d '{
    "model": "jev",
    "state": {
      "order": { "amount": 1280, "currency": "CNY" },
      "customer": { "risk_level": "medium" }
    },
    "questions": {
      "review": {
        "type": "choice",
        "instructions": "Decide whether this order can be approved.",
        "criteria": {
          "approve": "Approve when the risk is acceptable.",
          "reject": "Reject when the risk is unacceptable."
        }
      }
    }
  }'

Request body

FieldTypeRequiredDescription
modelstringYesDecision model code, up to 128 characters.
statenull | string | object | arrayYesBusiness state supplied to the model.
questionsobjectYes1–32 questions. Each key is a non-blank question ID up to 128 characters.
session_idstringNoCache-affinity session ID, up to 256 characters. Used for platform routing and not forwarded upstream.

System One extension fields outside these platform fields are forwarded using the native protocol. The request body limit is 64 KB.

Question types

Each question must contain type and may contain instructions. The supported types are:

typecriteriaUse
choiceObject with 1–255 choicesSelect a named result. Choice names must be non-blank and no longer than 128 characters.
scoreArray with 2–10 levelsScore against an ordered set of levels.
noulOmitted, null, or an objectReturn an open-ended, unconstrained answer. The literal type name is noul.

Successful response

The gateway preserves the upstream System One response. A successful response contains at least:

{
  "model": "<resolved-upstream-model>",
  "answers": {
    "review": { "...": "System One answer fields" }
  },
  "usage": {
    "input_tokens": 123,
    "output_tokens": 18
  }
}

The fields inside each answers entry are native to the selected System One model; clients should not assume a fixed nested shape. usage is used for billing. Input and output token prices are shown in the decision model catalog.

Optional headers

HeaderDescription
Idempotency-KeyUp to 255 characters. Reuse a stable value when retrying the same business request. The gateway derives an upstream idempotency key but does not cache or replay responses.
x-session-idCache-affinity session ID, used only when the request body does not contain session_id.
x-trace-idBusiness trace ID recorded with request and usage data.
x-user-idEnd-user ID from your application.
x-agent-nameCalling agent or service name.

Error response

Errors use the OpenAI-style envelope:

{
  "error": {
    "message": "model is required and must not exceed 128 characters",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}
HTTP statusMeaning
400Invalid JSON or request body parsing failure.
401Missing, malformed, or invalid API key.
422Invalid state, model, questions, question type, idempotency key, or session identifier.
502All eligible upstream routes failed, or the upstream response was invalid.