Decision API
Send a document or a JSON record, get back a probability for every allowed answer of every question, in one model pass. No free text to parse. Each use case (inside a pack) fixes the questions and options; you only send the input. With a custom schema you can also ask your own questions.
· Auth Authorization: Bearer ma_… · Format JSON, UTF-8Quick start
Response:
Use decision.option for the answer and decision.band to decide what to do with it: act (run automatically), confirm (ask a person to confirm), human (hand over). Bands come from the pack's thresholds, by default act > 0.9, confirm 0.5–0.9, human < 0.5; you can apply your own thresholds to confidence.
Authentication and keys
MediaAtlas issues one key per customer or integration. Send it as a Bearer token. Keys can be limited to some packs, a request rate and a monthly token quota. Keep keys on your server; never put them in browser code. A leaked key is revoked and replaced on request.
POST/v1/decisions
Body
| field | type | |
|---|---|---|
pack | string | Pack id, e.g. accounts-payable. See the reference below or GET /v1/packs. |
usecase | string | Use-case id within the pack, e.g. approval_gate. |
input | string | object | One document (text) or record (JSON object). Some use cases require JSON fields, listed per use case. |
inputs | array | Instead of input: up to 32 inputs decided in one call. Results come back in the same order. |
questions | object | Optional custom schema instead of pack/usecase, see Custom questions. |
model | string | Optional; leave it out to use the default. GET /v1/models lists what is available. |
Response
| field | |
|---|---|
id | Request id (dec_…), quote it in support requests. |
model | Model tier that decided. |
results[] | One per input. decision: the use case's main question with option, confidence, band. answers: every question with option, confidence, band and probabilities for all options; score questions add expected (probability-weighted level) and level. Ranking use cases return ranking[] of {id, score} instead. |
usage | input_tokens, output_tokens (always 0, see Billing), decisions (inputs × questions). |
latency_ms | Time spent on the server. |
Custom questions
Send questions instead of pack/usecase. Each question has a type: choice (named options), score (ordered levels, low to high) or noul (yes/no), an instructions sentence, and criteria: for choice an object {option: "when to pick it"}, for score a list of level descriptions. Write criteria as decision rules; the model reads them.
Other endpoints
GET/v1/models – available tiers and the default.
GET/v1/packs – every pack and use case with its input description, questions and options (no key needed).
GET/v1/packs/{pack} – one pack.
GET/v1/usage – this month's requests, decisions and tokens for your key, plus quota and rate limit.
Errors
Errors return {"error": {"code", "message"}}.
| status | code | meaning |
|---|---|---|
| 400 | invalid_json, missing_input, invalid_inputs, invalid_schema | Fix the request. |
| 401 | missing_key, invalid_key | No key, unknown or revoked key. |
| 403 | pack_not_allowed | The key is not enabled for this pack. |
| 400 | unknown_model | The model is not available here; see /v1/models. |
| 404 | unknown_pack, unknown_usecase | Check ids in /v1/packs. |
| 413 | input_too_large | An input is over 20,000 characters; split it. |
| 422 | input_mismatch | The use case needs JSON fields the input does not have. |
| 429 | rate_limited, quota_exceeded | Wait for Retry-After seconds, or ask for a higher quota. |
| 503 / 504 | busy, timeout | Retry with backoff. |
Billing and limits
API use is included in your MediaAtlas plan up to the agreed monthly volume; MediaAtlas sets up the integration and issues keys for your developers. Usage is metered per key in input tokens: the input plus the use case's questions and options as the model reads them. Decision models do not generate text, so output_tokens is always 0. Longer inputs and more questions cost more tokens; a batch (inputs) costs the same as separate calls but is faster. GET /v1/usage shows the running total. Request content is not stored, only counts and timings.
Client examples
Python
JavaScript (server side)
C# (.NET)
Pack reference
Generated from the pack definitions served by GET /v1/packs, so it always matches the running server.