Drex

Evaluate questions

- Billing: only a 200 is billed, at the per-input-token price. - Unknown keys: top-level keys Drex doesn't know are ignored.

POST
/v1/systemone
  • Billing: only a 200 is billed, at the per-input-token price.
  • Unknown keys: top-level keys Drex doesn't know are ignored.

Checks run in this order and stop at the first failure:

  1. API pause (529)
  2. Key and credit (401, 402)
  3. Rate limits (429, 529)
  4. Body validation (422)
  5. Model evaluation (422 for too many tokens, 529 when the model service does not answer within 55 seconds)

Authorization

bearerAuth
AuthorizationBearer <token>

Your API key, sent as Authorization: Bearer nace_sk_...

  • Where: the dashboard's API Keys page. It is shown once, when you create it.
  • Format: nace_sk_ followed by 43 URL-safe characters (A-Z, a-z, 0-9, _ and -).
  • Limit: an account can hold at most 3 active keys.
  • Wrong or missing key: returns 401 authentication_error.

In: header

Header Parameters

X-Nace-Legendstring

The shape of a score answer's legend: array or object. Without it, legend is an array, except for a request with an X-TypeSafe-SDK header (any non-empty value) or a User-Agent that starts with typesafe-sdk/ or langchainjs-typesafe/, which gets an object keyed by the level index. This header wins in both directions. Any other value is ignored. Only the shape changes.

Value in"array""object"

Request Body

Unknown top-level keys are ignored.

stateStaterequired

Any JSON value: string, number, boolean, null, object, or array. Drex passes it to the model as is. The key must be present, but null is accepted.

questionsobjectrequired

Map of question id to question.

  • Count: at least 1 and at most 512 questions; drex-max-v1.1 and drex-max-finance allow 255 options or levels per question.
  • Ids: non-empty, and not only whitespace.
  • Size: state and questions (and images when it is nonempty), serialized together as JSON, must be at most 4194304 bytes.
  • Token limits: drex-v2.0 allows 131,072 state tokens and 262,144 tokens for the state plus its longest question. drex-max-v1.1 and drex-max-finance allow 262,144 tokens across the whole packed request: state, images, every question, and formatting and decision markers. Retired model ids follow their successor's limits.
  • Text only: images, audio, video and PDFs anywhere in state or questions are rejected with a 422. That covers base64 data URLs, raw base64 files, and OpenAI, Anthropic and Gemini media content parts. drex-max-v1.1 and drex-max-finance read images from the top-level images array instead.
Properties1 <= properties <= 512
Show child attributes
modelstring

Optional. Which version answers the request.

  • Active pinned id (drex-v2.0, drex-max-v1.1, drex-max-finance): served by that version.
  • drex-latest: served by the version it points to, currently drex-v2.0. It moves to a newer version only on an announced date.
  • Retired id (drex-v1.0, drex-v1.1, drex-v1.5 or drex-max → drex-max-v1.1): served at its successor's price and limits, and the response model reports the successor.
  • Legacy nacedm-latest, or no model: served like drex-latest.
  • Not available yet: a registered id unavailable to the API key in this environment returns 422 with issue path model.
  • Anything else, including an unregistered drex-* name or a TypeSafe SDK default such as jev-latest: returns 422 with issue path model.

GET /v1/models lists the models available to the requesting API key in that environment, each alias with its alias_for, and a retired id with alias_for set.

Match^(?:drex|nacedm)-[A-Za-z0-9.-]+$
imagesarray<string | object>

Served by drex-max-v1.1 or drex-max-finance, including retired ids that resolve to Max v1.1; any other model returns 422 images require drex-max-v1.1 or drex-max-finance. Ordered images shared by every question, placed before the state; refer to them as Image 1, Image 2 and so on. Up to 16 MiB per image and 32 MiB combined. Use workspace_file references to uploaded files for large images; inline images count toward the 4 MiB body limit. PNG, JPEG or WebP, up to 40 megapixels before resizing. Both allow at most 255 options or levels per question, with or without images.

Itemsitems <= 8
Show child attributes

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/systemone" \  -H "Content-Type: application/json" \  -d '{    "model": "drex-v2.0",    "state": "I was charged twice for my March invoice. Please refund one of the charges.",    "questions": {      "category": {        "type": "choice",        "instructions": "What is this support ticket about?",        "criteria": {          "billing": "Payments, invoices, refunds, or charges",          "technical": "Bugs, errors, or outages",          "account": "Login, profile, or permissions",          "other": null        }      },      "sentiment": {        "type": "score",        "instructions": "How upset is the customer?",        "criteria": [          "Calm",          "Mildly annoyed",          "Frustrated",          "Angry"        ]      },      "wants_refund": {        "type": "noul",        "instructions": "Is the customer asking for a refund?"      }    }  }'

{  "model": "drex-v2.0",  "answers": {    "category": {      "type": "choice",      "choice": "billing",      "confidence": 0.986,      "probabilities": {        "billing": 0.9895,        "technical": 0.005,        "account": 0.0006,        "other": 0.0049      }    },    "sentiment": {      "type": "score",      "score": 1.5306,      "legend": [        "Calm",        "Mildly annoyed",        "Frustrated",        "Angry"      ],      "probabilities": {        "0": 0.1572,        "1": 0.3516,        "2": 0.2946,        "3": 0.1966      },      "confidence": 0.7183    },    "wants_refund": {      "type": "noul",      "noul": 0.9868,      "confidence": 0.9868    }  },  "usage": {    "input_tokens": 106,    "output_tokens": 212  },  "evaluation_time_ms": 142.6,  "request_id": "req_0123456789abcdef0123456789abcdef"}