API reference

API reference · Routing

Why the router would choose this world

POST/api/router/explainAPI key

A dry run of the autopilot decision, spending nothing. Send the same x-antimatter-route directive a real request would carry, in the header or inline as `route`, and read back the scored pool, the constraints, and the reason. Resolves inside this key's allowlist, exactly as dispatch would, so what you see here is what you will get.

Request body

application/json, optional

Request body fields
FieldTypeWhat it is
modelstringAn autopilot id. Defaults to antimatter/auto.
messagesarray of objectOptional. The request's messages, so the dry run is steered the way dispatch is: an image needs a world that sees, the size a context that holds it. tools, response_format and max_tokens are read too.
routeobjectThe routing directive, same shape as the header.

Example

{
  "model": "antimatter/auto",
  "messages": [
    {}
  ],
  "route": {}
}

Answer 200

The decision and its reasoning.

Fields of the 200 answer
FieldTypeWhat it is
requestedstring
chosenstring or nullNull when no world satisfied the constraints.
allowlistedbooleanTrue when this key narrowed the pool.
warningsarray of string
explainobjectPolicy, weights, constraints, pool size, the rejected sample, and the scored winner with each axis marked measured or not.

Errors

  • 400OpenAI shaped error.
  • 401OpenAI 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.

Antimatter