Decision API

decision gateway

Try it
preset
plain text
images (optional)
Drop images or click to browse
JPEG / PNG / WebP · up to 8 · counts toward the 4 MiB body cap
question
string
Rate limit
  • 240 requests / minute per IP, counted with a sliding window. This leaves headroom below the aggregate upstream capacity so one caller cannot starve the others.
  • Exceeding it returns 429 with a Retry-After header.
  • Requests queue instead of failing: the gateway waits for upstream capacity, then answers or times out.
  • Every response carries X-Request-Id for tracing.
Models
  • drex-max-v1.2 — general decision model, the default.
  • drex-max-finance — tuned for financial documents and statements.
  • drex-latest — alias that always resolves to the newest release.
  • Any other model returns 404 model_not_found.
Usage

How it works

Send state and questions. Any JSON value as state, plus typed questions.
Read the answers. One typed answer per question, each with calibrated probabilities.
Stay in budget. 240 requests/minute per IP; on 429 wait for Retry-After seconds.

Endpoint

Method & path Description
POST /v1/systemone JSON body with model, state, questions and optional images. Rate-limited.
POST /v1/decision Alias of the endpoint above: identical schema, identical scheduling.
GET /health Liveness probe. Returns the queue depth.

curl

curl -X POST http://HOST/v1/systemone \
  -H "Content-Type: application/json" \
  -d '{
    "state": "I was charged twice.",
    "questions": {
      "refund": {
        "type": "noul",
        "instructions": "Asking for a refund?"
      }
    }
  }'

The image variant adds images: an array of base64 data URLs.

JavaScript

const r = await fetch("http://HOST/v1/systemone", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    state: "I was charged twice.",
    questions: {
      refund: { type: "noul", instructions: "Asking for a refund?" }
    }
  }),
});
const { answers } = await r.json();

Python

import requests

r = requests.post(
    "http://HOST/v1/systemone",
    json={
        "state": "I was charged twice.",
        "questions": {
            "refund": {"type": "noul",
                       "instructions": "Asking for a refund?"}
        },
    },
)
print(r.json()["answers"]["refund"]["noul"])

Success response

{
  "model": "drex-max-v1.2",
  "answers": {
    "refund": {
      "type": "noul",
      "noul": 0.9016,
      "confidence": 0.9016
    }
  },
  "usage": { "input_tokens": 93, "output_tokens": 34 },
  "evaluation_time_ms": 162.1,
  "request_id": "req_4fc844529981f453e27c309bd383e195"
}

noul is the probability of "yes". choice answers carry probabilities per label, score answers carry a position and a legend.

Models

This endpoint is a decision wrapper: only the decision family is reachable. Pick one with model, or omit it for the default.

Model Use for
drex-max-v1.2 general decision model — the default
drex-max-finance financial documents and statements
drex-latest alias that resolves to the newest release

Other drex-* and nacedm-* ids also pass. Anything else returns 404 model_not_found before it reaches the queue.

No API key is required. If your client sends an Authorization or X-API-Key header it is accepted and ignored.

instructions

instructions belongs to each question, not to the request. It may be a string, a JSON object, an array, or null. Structured instructions are how you pass a schema or field definition alongside the question.

{
  "state": { "source_text": "Invoice #4471 issued March 3, 2026 ..." },
  "questions": {
    "invoice_number_is_correct": {
      "type": "noul",
      "instructions": {
        "field": { "name": "invoice_number", "type": "string" },
        "extracted_value": "4471",
        "question": "Does extracted_value match the field?"
      }
    }
  }
}

There is no top-level instruction field. A bare number or boolean is rejected.

Question types

noul yes/no; needs instructions or criteria
choice one label out of criteria
score graded scale; criteria is an ordered array

Errors

All errors use one JSON envelope:

{ "error": { "type": "invalid_request_error",
             "message": "questions must be a non-empty object",
             "code": "validation_error",
             "retryable": false },
  "request_id": "req_..." }
422 malformed JSON, missing state or questions, unsupported image
429 quota exceeded; wait Retry-After seconds, then retry
503 queue full or upstream unavailable; retry with backoff
504 request expired while waiting for capacity; retry later

Other codes: body_too_large · queue_full · upstream_*