Using decisions

A decision model answers typed questions about a piece of text or JSON — the state — in a single pass. It never generates text: every answer is a probability distribution over options you define in the request. That makes it fast (tens of milliseconds), cheap, and predictable enough to put in front of a workflow: routing a ticket, screening a message, deciding whether to escalate.

Try it without writing code in the playground.

The endpoint is POST https://helexa.ai/v1/systemone, and it speaks the TypeSafe Jev protocol, so existing Jev clients work unchanged.

A request

{
  "state": "I was charged twice this month and want the duplicate refunded.",
  "questions": {
    "queue": {
      "type": "choice",
      "instructions": "Which team should handle this ticket?",
      "criteria": {
        "billing": "payments, invoices and refunds",
        "technical": "login, bugs and app issues",
        "other": "anything else"
      }
    },
    "urgency": {
      "type": "score",
      "instructions": "How urgent is this ticket?",
      "criteria": ["low", "normal", "high", "critical"]
    },
    "refund": {
      "type": "noul",
      "instructions": "Is the customer asking for money back?"
    }
  }
}

Every question over the same state is answered in the same request, and answers comes back in the order you asked.

The three question types

TypeAskscriteriaAnswer
noulIs a statement true?optional {"true": …, "false": …} descriptionsnoul: P(true)
scoreWhere does this fall on a scale?a list of levels, lowest firstscore: the expected level, which can fall between two
choiceWhich of these options?an object of label: description, or a list of labelschoice: the most likely label

A noul question also takes labels, e.g. {"true": "late", "false": "on time"}, to name its two answers.

Every answer carries probabilities for each option (choice and score), plus two confidence numbers that are not interchangeable:

The state

Order matters: the model reads question ids, option labels and object keys in the order they arrive.

Languages and checkpoints

The model family has three checkpoints: English, multilingual and typed-decisions. By default the service picks one from the language of the state — Hindi, Japanese, Arabic, Russian and non-English Latin text all go to the multilingual checkpoint — and the response's routing block says which answered and why.

Send "model": "multilingual" (or english, typed-decisions) to pin one. helexa/one is the class alias, and any model name the service doesn't recognise — such as a Jev client's own — falls back to it.

Limits and budgets

Metering

Decisions are metered in input tokens, reported in usage.input_tokens; output_tokens is always zero. Each question is encoded together with the state, so every extra question over a long state costs that state again.

Errors

Errors use the same envelope as the rest of the API, plus a detail string with the exact reason: