Skip to main content
POST
Decisions

Overview

The /v1/scaledown endpoint mirrors TypeSafe’s Jev Decisions API request/response shape. You send a state object plus a questions map, and get back one typed answer per question. choice and noul questions are answered using the same calibrated scoring /classify uses; score questions are not supported - see score behavior below.

Request

string
default:"classify-1"
Optional. The only supported value is "classify-1", which is also the default when omitted. Any other value is rejected with 422.
object
required
The item being decided on.
object
required
A map of question name → question definition. Must contain at least one entry. Every question is answered against the same state, concurrently.

Response

string
Always "classify-1".
object
Map of question name → typed answer, matching the questions keys from the request.
object
Token usage and cost, summed across every internal call the request fanned out to (one per choice/noul question).

score behavior

We have no ordered-scale scoring primitive, so a score question is never actually evaluated. What happens depends on whether the request has anything else in it:
  • Mixed request (at least one choice/noul question alongside the score question(s)): returns 200. The choice/noul questions are answered normally; each score question’s answer comes back as {"type": "unsupported", "reason": "..."} and contributes nothing to usage.
  • All-score request (every question in questions is type score): returns 422. Nothing in the request could be answered, so it fails outright instead of returning a 200 full of "unsupported" placeholders.

Error responses

Authentication

Include your API key in every request using the x-api-key header.

Examples

Single choice question

Response:

Mixed choice + noul questions

choice and noul questions can be combined in one request. Both are answered concurrently against the same state.
Response:

A score question in the mix

score questions are accepted but always answered as "unsupported" - the rest of the request still succeeds.
Response: sentiment is answered normally; quality_score comes back as unsupported and costs nothing.

An all-score request

When every question in the request is score, nothing can be answered, so the request fails with 422 instead of returning 200 with everything marked unsupported.
Response: 422 Unprocessable Entity

Notes

  • "classify-1" is the only supported model. Omit it (defaults to "classify-1") or pass it explicitly - any other value is rejected with 422.
  • Every choice/noul question in a request is one separate calibrated model call, run concurrently. usage is the sum across all of them - a request with a choice and two noul questions makes 3 calls and bills for all 3.
  • A request made entirely of score questions returns 422, not 200 - see score behavior.
  • No reasoning field exists on this endpoint - it never generates a free-form explanation, unlike /classify with reasoning: true.
  • No batching - each request evaluates one state. To classify many items, use /classify’s chunks array instead.
  • See Differences from Jev for the full compatibility matrix.

Authorizations

x-api-key
string
header
required

Body

application/json
state
object
required

The item being decided on. Provide text, document, or both.

questions
object
required

Map of question name to question definition. Must contain at least one entry.

model
enum<string>
default:classify-1

Optional. "classify-1" is the only supported value and also the default when omitted. Any other value returns 422.

Available options:
classify-1

Response

Successful decision

model
string

Always "classify-1".

answers
object

Map of question name to typed answer, matching the questions keys from the request.

usage
object

Token usage and cost, summed across every internal call the request fanned out to.