API reference

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

Request body fields
FieldTypeWhat it is
modelrequiredstringA 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.
modelsarray of stringOrdered 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.
messagesrequiredarray of object
messages[].rolerequiredstringOne of "system", "user", "assistant", "tool".
messages[].contentstring or array of object or null
messages[].tool_call_idstringAt most 300 characters.
messages[].namestringAt most 300 characters.
messages[].tool_callsarray of object
streambooleanServer-sent events in the OpenAI chunk format, terminated by data: [DONE].
max_tokensintegerClamped 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.
temperaturenumberFrom 0 to 2.
top_pnumberFrom 0 to 1.
stopstring or array of string
toolsarray of objectPassed through to the upstream verbatim.
tool_choicestring or object
parallel_tool_callsboolean
response_formatobjectPassed through to the upstream verbatim.
seedintegerFrom -9007199254740991 to 9007199254740991.
frequency_penaltynumberFrom -2 to 2.
presence_penaltynumberFrom -2 to 2.
promptobjectA 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.idrequiredstring
prompt.versioninteger or stringA version number, or a label such as production.
prompt.labelstring
prompt.variablesobjectA 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)
Request headers
FieldTypeWhat it is
x-antimatter-sessionstringA free form label that groups requests in the log. Printable ASCII, trimmed to 120 characters. At most 120 characters.
Antimatter