API reference · Public
Anonymous single model completion
POST/api/compareNo key
The chat board, the planet consoles, the bridge and the docs tester run on this path. No key. Rate limited per IP address, always streams, and forces max_tokens to 1024. Presets, aliases, BYOK, and credits do not apply.
Request body
application/json, required
| Field | Type | What it is |
|---|---|---|
| modelrequired | string | A catalog id from GET /v1/models, one of your aliases, preset/<name>, or an autopilot policy id (antimatter/auto, antimatter/auto:cheap, antimatter/auto:fast, antimatter/auto:code, antimatter/auto:extract, antimatter/auto:reason, antimatter/auto:long, antimatter/auto:vision, antimatter/auto:tools, antimatter/auto:json). At most 200 characters. |
| models | array of string | Ordered fallback list tried in turn when a candidate fails with a retryable error (429 or 5xx). At most 4 entries, so at most 5 candidates including model. The x-antimatter-model response header names the id that actually answered. |
| messagesrequired | array of object | |
| messages[] | string | One of "system", "user", "assistant", "tool". |
| messages[] | string or array of object or null | |
| messages[] | string | At most 300 characters. |
| messages[] | string | At most 300 characters. |
| messages[] | array of object | |
| stream | boolean | Server-sent events in the OpenAI chunk format, terminated by data: [DONE]. |
| max_tokens | integer | Clamped rather than refused: to the model's own published max output where the catalog has it (max_output_tokens on its GET /v1/models entry), and to the deployment ceiling (ANTIMATTER_MAX_OUTPUT_TOKENS, 131072 by default). A clamp is announced as max_tokens=<sent> in x-antimatter-adjusted. Absent means 4096 (ANTIMATTER_DEFAULT_OUTPUT_TOKENS), or the model's max output if that is lower. At most 9007199254740991. |
| temperature | number | From 0 to 2. |
| top_p | number | From 0 to 1. |
| stop | string or array of string | |
| tools | array of object | Passed through to the upstream verbatim. |
| tool_choice | string or object | |
| parallel_tool_calls | boolean | |
| response_format | object | Passed through to the upstream verbatim. |
| seed | integer | From -9007199254740991 to 9007199254740991. |
| frequency_penalty | number | From -2 to 2. |
| presence_penalty | number | From -2 to 2. |
| prompt | object | A prompt kept here: its version's messages come before these, and a request that names no model takes the version's. With no version or label, the production label when it is set, else the newest version. |
| prompt. | string | |
| prompt. | integer or string | A version number, or a label such as production. |
| prompt. | string | |
| prompt. | object | A value for every {{variable}} the version names, and no others. |
Example
{
"model": "antimatter/auto",
"messages": [
{
"role": "user",
"content": "Say hello in five words."
}
]
}Answer 200
SSE stream of OpenAI format chunks.
The answer's fields are not named in the document.
Errors
- 400OpenAI 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.
Request headers it reads (1)
| Field | Type | What it is |
|---|---|---|
| x-antimatter-session | string | A free form label that groups requests in the log. Printable ASCII, trimmed to 120 characters. At most 120 characters. |