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
| Field | Type | What it is |
|---|---|---|
| model | string | An autopilot id. Defaults to antimatter/auto. |
| messages | array of object | Optional. 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. |
| route | object | The routing directive, same shape as the header. |
Example
{
"model": "antimatter/auto",
"messages": [
{}
],
"route": {}
}Answer 200
The decision and its reasoning.
| Field | Type | What it is |
|---|---|---|
| requested | string | |
| chosen | string or null | Null when no world satisfied the constraints. |
| allowlisted | boolean | True when this key narrowed the pool. |
| warnings | array of string | |
| explain | object | Policy, 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.