API reference

API reference · Recorder

Replay a captured request

POST/api/traces/replaySigned in session

Runs the captured request again, against the same model or another one, and returns both answers with their costs and latencies. A replay is a real request through the one dispatch path: it is metered and charged. With quote: true nothing runs: the answer is the most the replay could be billed, the gateway's own worst case for that request on that model.

Request body

application/json, required

Request body fields
FieldTypeWhat it is
traceIdrequiredstring32 hex characters.
modelstringOptional. A different world.
quotebooleanPrice it; run nothing.

Example

{
  "traceId": "string",
  "model": "antimatter/auto",
  "quote": false
}

Answer 200

The two answers side by side, or with quote the replay's price.

Fields of the 200 answer
FieldTypeWhat it is
traceIdstring
originalReplaySide
original.modelstring
original.upstreamstring or null
original.statusinteger
original.ttftMsinteger or null
original.totalMsinteger or null
original.promptTokensinteger
original.completionTokensinteger
original.costMicrosinteger
original.bodystring or nullUntrusted text. Render escaped.
original.truncatedboolean
original.errorstring or null
replayReplaySide
replay.modelstring
replay.upstreamstring or null
replay.statusinteger
replay.ttftMsinteger or null
replay.totalMsinteger or null
replay.promptTokensinteger
replay.completionTokensinteger
replay.costMicrosinteger
replay.bodystring or nullUntrusted text. Render escaped.
replay.truncatedboolean
replay.errorstring or null

Errors

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