---
name: decision-models
description: Make typed decisions with the MediaAtlas decision models (decision.mediaatlas.si): send a text, record or image plus a use case, get a probability for every option and an act / confirm / human band. Use when the user asks to route, triage, classify, gate a tool call, score or review something with probabilities instead of free text, to make a key for another agent, or to buy or check a decision-model plan.
---

# MediaAtlas decision models

A decision model reads a state (a document, a JSON record, up to 8 images or video frames) plus typed questions and returns a probability for every allowed option in one forward pass. There is no text to parse: the answer is always one of the options, with a confidence and a band (`act` runs automatically, `confirm` asks a person, `human` hands over). Reference: https://decision.mediaatlas.si/docs and https://decision.mediaatlas.si/llms-full.txt (every pack and use case).

## The key

1. The key is in the environment as `DECISION_API_KEY` (it starts with `ma_`). Never print it, never put it in a repository, never send it anywhere but `decision.mediaatlas.si`.
2. No key yet? A person pays once with Stripe. Make them a payment link and ask them to send you the key shown after paying:
   `python3 scripts/decide.py buy developer` (EUR 19 a month, 100 M tokens) or `python3 scripts/decide.py buy team` (EUR 99 a month, 1,000 M tokens). Or point them to https://decision.mediaatlas.si/#pricing.
3. **Each agent should have a key of its own.** If you are the agent and the person gave you a plan key, ask for an agent key rather than reusing theirs: `python3 scripts/decide.py agent-key "<your name>" --budget 5000000` makes one (shown once) that spends the same plan, with a monthly token budget of its own and a revocation of its own. An agent key cannot make keys.

## Decide

```
python3 scripts/decide.py packs                                  # the packs and use cases (no key needed)
python3 scripts/decide.py decide core routing "Summarise this contract and flag risky clauses"
python3 scripts/decide.py decide core guardrails --file prompt.txt
python3 scripts/decide.py decide core routing --image photo.jpg
```

It prints the main answer, its confidence and band, and the probabilities. Without the script:

```
curl -X POST https://decision.mediaatlas.si/v1/decisions -H "Authorization: Bearer $DECISION_API_KEY" -H "Content-Type: application/json" \
  -d '{"pack": "core", "usecase": "routing", "input": "..."}'
```

Use `inputs` (up to 32) to decide many things in one call, `model` (only `fast` is offered; leave it out), or `questions` instead of `pack`/`usecase` for a custom schema (see the docs).

## What to do with the answer

- `band: act`: act on `decision.option` automatically.
- `band: confirm`: ask a person before acting.
- `band: human`: do not act; hand over.
- You may apply your own thresholds to `confidence`. Never act on a decision whose use case does not fit the input; a `422 input_mismatch` means it does not.

## Errors you will meet

| HTTP | `error.code` | What to do |
|---|---|---|
| 401 | `invalid_key` | Unknown or revoked key: ask the person for a new one. |
| 402 | `payment_required` | The plan's payment failed, the key is paused until it is paid. Give the person https://decision.mediaatlas.si/#pricing, or `python3 scripts/decide.py buy developer` for a link. |
| 429 | `rate_limited`, `too_many_concurrent` | Wait the `Retry-After` seconds; send fewer requests at once. |
| 429 | `quota_exceeded` | The plan's tokens are used up until the 1st. Tell the person; a bigger plan fixes it. |
| 429 | `agent_budget_exceeded` | This agent key spent its own budget; the plan key can raise it (`agent-key` makes a new one). |
| 503 | `busy` | Retry in a few seconds with backoff. |

`python3 scripts/decide.py usage` shows the plan, the tokens used and left this month, and your agent budget.

## Privacy

Request content is never stored, only counts and timings. Do not send secrets or personal data you have no right to process.
