API reference

API reference · API

Resume a stream

GET/v1/streams/{id}API key

Replays every event of a resumable stream after ?after=<n> or the Last-Event-ID header, whichever is later, then follows the stream until it ends, in the format of the wire that opened it: OpenAI chunks, Anthropic events, or Responses events with their own sequence numbers. Each event carries its number as the SSE id. The key must be the one that opened the stream or another key of the same account; anything else, an unknown id and an expired one are all the same 404. When the stream passed its byte cap, failed, or lost the invocation generating it, the replay ends with an error in the wire's own shape whose type or code is stream_truncated, stream_failed or stream_lost. A tail closes on its own after ANTIMATTER_RESUME_TAIL_MS (270 s); reconnect with Last-Event-ID to carry on.

Parameters

Path and query parameters
FieldTypeWhat it is
id (path)requiredstringThe x-antimatter-stream-id of the answer.
after (query)integerReplay events numbered after this one. 0 or absent replays them all. At least 0.

Answer 200

The stream's events, numbered, in its own wire's format.

Headers: x-antimatter-stream-id, x-antimatter-stream-status

The answer's fields are not named in the document.

Errors

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

Request headers it reads (1)
Request headers
FieldTypeWhat it is
Last-Event-IDintegerThe standard SSE reconnect header; the later of it and after wins. At least 0.
Antimatter