Use case

Decisions API for classification

Classification is the job of picking a finite label for an input — which is exactly what a decision endpoint does natively. Instead of parsing a label out of generated text, you define the labels up front and get back the winner plus a probability for every option.

Updated

When finite labels fit

A decision call fits whenever your downstream code needs one of a known set of answers: ticket categories, moderation verdicts, intent labels, document types. If a human would pick from a fixed list, a choice question is the direct translation.

If your labels are unbounded — every input could be a new category — classification is not the right shape; you want generation. The sweet spot is a closed set you can name and describe.

  • Support ticket categories: billing, bug, account, other
  • Content moderation verdicts: spam, safe, needs review
  • Intent labels: refund, cancel, change plan, question

Single-label: one choice question

For single-label classification, send one choice question whose criteria map each label to a short description. Always include an 'other' or 'unclear' option — giving the model an honest exit keeps borderline inputs out of the wrong bucket.

Single-label choice

// Single-label classification: one choice question per call.
const res = await fetch("https://decisions-api.net/api/v1/decisions", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "decisions-1",
    state: "I was charged twice for my subscription this month.",
    questions: {
      category: {
        type: "choice",
        instructions: "Which category fits this support ticket best?",
        criteria: {
          billing: "Charges, invoices, refunds, or subscriptions.",
          bug: "Something is broken or returns an error.",
          account: "Login, password, or profile problems.",
          other: "None of the above fit.",
        },
      },
    },
  }),
});
// Illustrative response: answers.category ->
//   { choice: "billing", probabilities: {...}, confidence: 0.91 }

Multi-label: noul questions in one call

Multi-label classification — where several tags can be true at once — maps to several noul questions over the same state. Each noul question is a yes-probability for one label, and you can pack up to 6 questions in a single call for the same 1 credit.

Multi-label noul batch

// Multi-label moderation: several noul questions over the same state.
// Each noul answer is a yes-probability between 0 and 1.
const res = await fetch("https://decisions-api.net/api/v1/decisions", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "decisions-1",
    state: "Congratulations! Verify your account to claim your prize.",
    questions: {
      is_spam: { type: "noul", instructions: "Is this message spam or a scam?" },
      pushes_action: {
        type: "noul",
        instructions: "Does it push the reader to click, pay, or verify something?",
      },
      needs_review: {
        type: "noul",
        instructions: "Should a human moderator review this message?",
      },
    },
  }),
});
// Illustrative response: answers.is_spam -> { noul: 0.97 },
//   answers.needs_review -> { noul: 0.88 }

Severity and ordering: score

When the labels are ordered — low / medium / high, or P3 down to P0 — use a score question instead of a choice. The criteria are an array of level descriptions, lowest first, and the answer is a level index plus probabilities for every level.

Act on confidence, not just the label

The probability distribution is what makes automation safe. A reasonable starting point: apply the label automatically when confidence is 0.8 or higher, and send everything below that to human review. Tune the threshold on your own data — the right value depends on what a wrong label costs you.

FAQ

How many labels can one question have?

A choice question takes 2 to 8 options, and a score question takes 2 to 10 ordered levels. You can send up to 6 questions per call, so a single call can classify along several axes at once.

How do I do multi-label classification?

Send one noul question per label over the same state — up to 6 per call. Each answer is an independent yes-probability, so an input can be flagged for any combination of labels.

What does a classification call cost?

1 credit per successful call on this site, regardless of whether you ask 1 or 6 questions. Validation errors and upstream failures are free.

Classify something now

One free trial decision for new visitors — paste your own text into the playground and read the probabilities.