Skip to main content
Every call to POST /v1/decide has the same shape:
  • context is the text to decide on, such as a user message, a ticket or an agent step.
  • questions is a map of the decisions you want about that context, keyed by ids you choose.
  • answers has one answer per question, under the same ids, in the same order.

Questions

Each question has:

Options

Option ids are yours. Use the ids your code already understands, like transaction_charged_twice or calendar_search. Krun returns them exactly as sent, in choice and in probabilities. Option ids can be 1 to 200 characters. The description is optional:
  • With a description, like "returns": "Returns and refunds", the model reads it to understand the option. Descriptions can be up to 1,000 characters.
  • Label-only, with "" or null, the model uses the option id alone. Use readable ids, like lost_or_stolen_card.
The choice between the two changes how reliable abstention is. See Abstention status.
Duplicate question ids or option ids, unknown fields and question types other than choice are rejected with 400 INVALID_REQUEST before any inference runs.

Answers

The response also has model, the model that answered, and usage.input_tokens. See Usage and tokens. The request id is not in the body. It is in the X-Request-ID response header, and the Python SDK exposes it as result.request_id.

Several questions per call

A request can carry up to 16 questions about the same context. They are answered together, in one model job. See Multiple questions.