{"article":{"title":"Decisions","breadcrumb":["Guides","Decisions"],"body":"**What this covers**: sending a text and a few questions and getting back the probability of each answer. Suited to intent detection, ticket routing and content screening, where the answer is one of a few options and no written reply is needed.\n\n### Compared with chat\n\n| | `POST /v1/decisions` | `POST /v1/chat/completions` |\n|---|---|---|\n| Reply | A probability for each answer to each question | Generated text |\n| One request | One text, up to 64 questions | One conversation |\n| Billing | Input tokens only | Input + output tokens |\n| Streaming | No | Yes |\n\nRequests and replies use the same format as TypeSafe Jev and OpenRouter Decisions. `POST /v1/systemone` is the same endpoint under the path name Jev and Microsoft Foundry use: code written for the Jev SDK works after changing the base URL to `https://tare.jamerly.ai`.\n\n### Models\n\n| Model | Languages | Price |\n|---|---|---|\n| `microsoft/microsoft-decision-1` | Chinese, English | Input $0.045 / M tokens, output free |\n\n### Request\n\n```bash\ncurl https://tare.jamerly.ai/v1/decisions \\\n  -H \"Authorization: Bearer $TARE_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d @request.json\n```\n\n`request.json`:\n\n```json\n{\n  \"model\": \"microsoft/microsoft-decision-1\",\n  \"state\": \"The box arrived empty. This is the second time!\",\n  \"questions\": {\n    \"complaint\": {\"type\": \"noul\", \"instructions\": \"Is the customer complaining?\"},\n    \"team\": {\n      \"type\": \"choice\",\n      \"instructions\": \"Which team should handle this message?\",\n      \"criteria\": {\"billing\": \"payments, charges, refunds\", \"shipping\": \"deliveries, missing items\", \"product\": \"quality, taste\"}\n    },\n    \"anger\": {\"type\": \"score\", \"instructions\": \"How angry is the customer?\", \"criteria\": [\"calm\", \"annoyed\", \"angry\", \"furious\"]}\n  }\n}\n```\n\n| Field | Description |\n|---|---|\n| `model` | Required |\n| `state` | Required. The text the questions are about; may also be a JSON object or array, and every string in it is read |\n| `questions` | Required. Named questions, up to 64. `answers` in the reply uses the same names |\n| `questions.*.type` | `noul` (yes/no), `choice` (one of several options), `score` (a level on a scale) |\n| `questions.*.instructions` | The question itself |\n| `questions.*.criteria` | `choice`: option name → description (may be an empty string), at least two. `score`: levels from lowest to highest, at least two |\n\n### Reply\n\n```json\n{\n  \"id\": \"gen-7f3c1a9e2b4d4c6f8a0e1b2c3d4e5f60\",\n  \"model\": \"microsoft/microsoft-decision-1\",\n  \"answers\": {\n    \"complaint\": {\"type\": \"noul\", \"noul\": 0.999},\n    \"team\": {\n      \"type\": \"choice\", \"choice\": \"shipping\", \"confidence\": 0.99,\n      \"probabilities\": {\"billing\": 0.001, \"shipping\": 0.994, \"product\": 0.005}\n    },\n    \"anger\": {\n      \"type\": \"score\", \"score\": 2.07, \"confidence\": 0.87,\n      \"legend\": {\"0\": \"calm\", \"1\": \"annoyed\", \"2\": \"angry\", \"3\": \"furious\"},\n      \"probabilities\": {\"0\": 0.0004, \"1\": 0.016, \"2\": 0.93, \"3\": 0.05}\n    }\n  },\n  \"usage\": {\"input_tokens\": 98, \"output_tokens\": 3, \"cost\": 0.00000441}\n}\n```\n\n| Field | Description |\n|---|---|\n| `noul` | P(yes), from 0 to 1 |\n| `choice` | The most probable option |\n| `score` | The expected level, counted from 0; `legend` maps each index to its level name |\n| `probabilities` | `choice` / `score`: the probability of each option (level), summing to 1 |\n| `confidence` | `choice` / `score`: 0 means no better than an even spread, 1 means certain |\n| `usage.cost` | What this call was charged (USD) |\n| `id` | The call's id, the same as the `X-Generation-Id` response header |\n\n### Getting good answers\n\n- **Put the rule in the question.** For example: \"Our policy is to resend missing items within 30 days. Should this customer get a replacement?\" Asked only \"Should they get a replacement?\", the model can only guess from common sense.\n- **Do calculations in your own code.** Date comparisons, sums and scoring belong in code; put the result into the question.\n- **Send low-confidence answers to a person.** Set the threshold from your own data: run a hundred or two labelled real messages and find the line above which accuracy is good enough.\n- **Ask all questions about one text in one request.** One question and six questions take about the same time.\n\n### Other differences from chat\n\n- No `models` fallback chain and no `provider` routing preferences. Routing and failover follow the rules configured in the console.\n- No streaming; `stream: true` returns 400.\n- DLP applies as usual: `state` and the question texts are scanned.\n\n### Errors\n\n| Status | When |\n|---|---|\n| 400 | `model` / `state` / `questions` missing, an unknown question type, fewer than two options, or blocked by DLP |\n| 401 | No key, or an invalid key |\n| 403 | The key is disabled, expired or out of credit; the account is overdrawn; the monthly budget is used up |\n| 404 | No route is configured for this model |\n| 503 | The upstream is temporarily unavailable; retry shortly |\n\nThe error body format is described in [Errors](errors)."}}