API reference · API
Ask several models at once and combine the answers
POST/v1/ensembleAPI key
Every member is priced at its worst case before anything is sent, and the sum is held to max_cost_micros, the key's per request ceiling, the monthly cap and what the account can spend. Each member then runs as its own keyed chat completion (no presets, aliases or fallback), with its own request id, hold and usage row under the ensemble's id as session, and spends one request of the key's per minute window. The combined answer is computed: a vote, a field by field JSON vote, or the cheapest answer that passes a check; only the judge rule asks a model, the one the caller names, billed as one more member. A failed member does not fail the ensemble; all of them failing is a 502 ensemble_failed. stream is refused: the combined answer exists only at the end. On a deployment with $ANTI holder tiers the ensemble is for holders: a key whose minting account does not hold the lowest tier is refused with 403 holder_only.
Request body
application/json, required
| Field | Type | What it is |
|---|---|---|
| members | array of string or object | The models, as ids or autopilot ids, each optionally with its own max_tokens and temperature. Give these or preset. An autopilot id is routed before anything is priced, inside the key's allowlist and blocklist. |
| preset | string | A member list by name: tiers is antimatter/auto:cheap, antimatter/auto, antimatter/auto:quality. Two tiers that land on one model run it once. One of "tiers". |
| combine | object | The rule: majority (match, min_agreement), json-consensus (needs a JSON response_format), first-valid (the JSON check, pattern, or both) or judge (judge_model, which you name and pay for). majority when absent. |
| combine. | string | One of "majority", "json-consensus", "first-valid", "judge". |
| combine. | string | One of "normalized", "exact". |
| combine. | number | From 0 to 1. |
| combine. | string | At most 1000 characters. |
| combine. | string | At most 200 characters. |
| max_cost_micros | integer | Refuse the ensemble, sending nothing, when the worst case of every member and the judge together is over this, in micro dollars. At most 9007199254740991. |
| member_timeout_ms | integer | How long one member may run, 120000 ms when absent. A member past it is reported as timed out; one aborted after it reached the upstream is billed. From 1000 to 240000. |
| messagesrequired | array of any | The conversation every member answers. The rest of the body is a chat request every member shares; stream, model and models are refused. |
Example
{
"messages": []
}Answer 200
Every member's answer, cost and latency, and the combined answer.
Headers: x-antimatter-request-id, x-request-id, x-antimatter-cost-micros, x-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-reset
| Field | Type | What it is |
|---|---|---|
| id | string | ens_ and the request id's digits; every member's usage row carries it as its session. |
| object | "ensemble" | |
| created | integer | |
| rule | string | One of "majority", "json-consensus", "first-valid", "judge". |
| combined | object | The combined answer. ok false with a reason when no answer qualified (every answer failed the check, the plurality was under min_agreement, the judge named no candidate); the members are still there, and still billed. |
| combined. | boolean | |
| combined. | string or null | |
| combined. | integer or null | Whose answer it is; null for a field by field JSON merge. |
| combined. | number | The share of answering members behind it. |
| combined. | string | One of "computed", "model_judgment". |
| combined. | string | One of "field-wise", "whole". |
| combined. | array of object | |
| combined. | array of object | |
| combined. | array of object | |
| combined. | boolean | |
| combined. | string | |
| combined. | string | |
| members | array of object | |
| members[] | integer | |
| members[] | string | The id as given, autopilot ids included. |
| members[] | string | The model that answered and was billed. |
| members[] | integer | |
| members[] | boolean | |
| members[] | string or null | |
| members[] | array of object | |
| members[] | string or null | |
| members[] | object or null | |
| members[] | integer | What this member was billed. |
| members[] | integer | What it was priced at before sending. |
| members[] | integer | |
| members[] | string | Its own request id: GET /v1/requests/{id}. |
| members[] | boolean | |
| members[] | object | |
| members[] | string | |
| members[] | string | |
| judge | object | |
| judge. | integer | |
| judge. | string | The id as given, autopilot ids included. |
| judge. | string | The model that answered and was billed. |
| judge. | integer | |
| judge. | boolean | |
| judge. | string or null | |
| judge. | array of object | |
| judge. | string or null | |
| judge. | object or null | |
| judge. | integer | What this member was billed. |
| judge. | integer | What it was priced at before sending. |
| judge. | integer | |
| judge. | string | Its own request id: GET /v1/requests/{id}. |
| judge. | boolean | |
| judge. | object | |
| judge. | string | |
| judge. | string | |
| usage | object | Every member's tokens summed, and cost in dollars. |
| cost_micros | integer | |
| worst_case_micros | integer | |
| max_cost_micros | integer |
Errors
- 400OpenAI shaped error.
- 401OpenAI shaped error.
- 402OpenAI shaped error.
- 403OpenAI shaped error.
- 404OpenAI shaped error.
- 413OpenAI shaped error.
- 429Rate limited, or a spent budget or spend cap. The type distinguishes rate_limit_error, policy_exceeded, and spend_cap_exceeded.
- 502OpenAI shaped error.
- 503OpenAI shaped error.
Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.