> ## Documentation Index
> Fetch the complete documentation index at: https://docs.krun.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Krun API base URL: https://api.krun.ai. Authenticate server-side with `Authorization: Bearer $KRUN_API_KEY`; never put a Krun API key in browser code.
> Prefer the Python SDK in examples: `pip install krun-ai`, `from krun import Krun`. The TypeScript SDK `@krun-ai/sdk` is not published on npm yet: do not tell users to `npm install` it.
> The only question type is `choice`. `confidence` is the top-1 minus top-2 probability margin, not the probability that the answer is correct. `choice` is null when `abstain` is true.
> Usage reports `input_tokens` only. There are no output tokens.

# Multiple questions

> Ask up to 16 questions about the same context in one request: one HTTP call, one model job, one answer per question.

A single request can ask several questions about the same context. Krun answers all of them together:

```text theme={null}
1 HTTP request  →  1 model job  →  N answers
```

This is faster and simpler than one request per question: you make one round trip, handle one response and one request id, and all answers come from the same model job.

## Example

Classify a support message by department, priority and sentiment in one call:

<CodeGroup>
  ```python Python theme={null}
  from krun import Krun

  client = Krun()

  result = client.decide(
      context="My package never arrived and I need it for a wedding this Saturday.",
      questions={
          "department": {
              "type": "choice",
              "options": {
                  "shipping": "Shipping and delivery issues",
                  "returns": "Returns and refunds",
                  "billing": "Billing and payment issues",
              },
          },
          "priority": {
              "type": "choice",
              "options": {
                  "low": "Can wait",
                  "normal": "Normal priority",
                  "high": "Needs quick attention",
              },
          },
          "sentiment": {
              "type": "choice",
              "options": {"positive": "", "neutral": "", "negative": ""},
          },
      },
  )

  for question_id, answer in result.answers.items():
      print(question_id, answer.choice, answer.abstain)
  ```

  ```bash curl theme={null}
  curl https://api.krun.ai/v1/decide \
    -H "Authorization: Bearer $KRUN_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "context": "My package never arrived and I need it for a wedding this Saturday.",
      "questions": {
        "department": {
          "type": "choice",
          "options": {
            "shipping": "Shipping and delivery issues",
            "returns": "Returns and refunds",
            "billing": "Billing and payment issues"
          }
        },
        "priority": {
          "type": "choice",
          "options": {
            "low": "Can wait",
            "normal": "Normal priority",
            "high": "Needs quick attention"
          }
        },
        "sentiment": {
          "type": "choice",
          "options": { "positive": "", "neutral": "", "negative": "" }
        }
      }
    }'
  ```
</CodeGroup>

```json Response theme={null}
{
  "model": "krun-one-v0",
  "answers": {
    "department": {
      "type": "choice",
      "choice": "shipping",
      "confidence": 0.964244,
      "probabilities": { "shipping": 0.978313, "returns": 0.01407, "billing": 0.007617 },
      "abstain": false,
      "abstention_status": "advisory"
    },
    "priority": {
      "type": "choice",
      "choice": null,
      "confidence": 0.388209,
      "probabilities": { "low": 0.228391, "normal": 0.6166, "high": 0.155009 },
      "abstain": true,
      "abstention_status": "advisory"
    },
    "sentiment": {
      "type": "choice",
      "choice": "negative",
      "confidence": 0.998928,
      "probabilities": { "positive": 0.00009, "neutral": 0.000491, "negative": 0.999419 },
      "abstain": false,
      "abstention_status": "calibrated"
    }
  },
  "usage": { "input_tokens": 147 }
}
```

## How answers work

* **Same ids, same order.** `answers` has one entry per question, under your question ids, in request order.
* **Independent decisions.** Each question is scored on its own. One answer can abstain while the others don't, like `priority` above.
* **Per-answer abstention status.** Each answer has its own `abstention_status`. Here `sentiment` uses label-only options, so it is `calibrated`. The others have descriptions, so they are `advisory`.
* **Summed usage.** `usage.input_tokens` is the sum over all questions. See [Usage and tokens](/concepts/usage-and-tokens).
* **One request id** for the whole request. Feedback names the question with `question_id`. See [Feedback](/guides/feedback).

## Limits

| Limit                 | Value                                      |
| --------------------- | ------------------------------------------ |
| Questions per request | 1 to 16                                    |
| Options per question  | 2 to 64                                    |
| Question id           | 1 to 100 characters, unique in the request |

If any question is invalid, the whole request fails with `400` and no question is answered.

## When to use separate requests

Use separate requests when the questions are about different contexts, or when the second question depends on the answer to the first, such as choosing an intent inside a category.
