API reference

API reference · API

One request, by its id

GET/v1/requests/{id}API key

The usage row of a request this key made, by the x-antimatter-request-id (or x-request-id) its answer carried: model, status, tokens, what it was billed, timing and the error it was answered with. Only the key that made it may read it; every other id, and a request refused before dispatch (which keeps no row), is the same 404 with code request_not_found. Takes the read scope.

Parameters

Path and query parameters
FieldTypeWhat it is
id (path)requiredstringThe request id.

Answer 200

The request.

Headers: x-antimatter-request-id, x-request-id

Fields of the 200 answer
FieldTypeWhat it is
idstringThe request id.
object"request"
createdintegerUnix seconds.
modelstringThe model that served or last failed it.
upstreamstring
statusintegerThe status the caller was answered with.
cachedboolean
attemptsintegerUpstream attempts behind it.
usageobject
usage.prompt_tokensinteger
usage.completion_tokensinteger
usage.total_tokensinteger
cost_microsintegerWhat it was billed, in micro dollars.
costnumberThe same, in dollars.
ttft_msinteger or null
total_msinteger or null
sessionstring or nullIts x-antimatter-session label.
errorobject or nullThe error the caller was answered with, the message truncated.
error.typestring
error.messagestring

Errors

  • 401OpenAI shaped error.
  • 403OpenAI shaped error.
  • 404OpenAI shaped error.
  • 429Rate limited, or a spent budget or spend cap. The type distinguishes rate_limit_error, policy_exceeded, and spend_cap_exceeded.

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