Request
POST a JSON body with aproject string and a traces array to
https://api.runmirrors.com/api/collect, authenticated with a workspace key as a
bearer token. Each trace carries an id and an OpenAI-style messages array.
Fields
string
required
The project the traces belong to. Mirrors are built per project, so keep one project per agent.
array
required
A batch of traces. Each trace has an
id (string, unique per trace), an optional model, and messages, an OpenAI-style chat array (system / user / assistant / tool roles, with tool_calls on assistant messages and tool_call_id on tool results).Behavior
- Batching is up to you; the official collectors default to 50 traces per POST, flushed every 2 seconds.
- Ingest is forgiving about
messages: alongside the OpenAI-style array above, it detects and flattens Vercel AI SDK messages (UIMessageparts,ModelMessagecontent blocks, agenerateTextstepsresult), Anthropic-block agent-loop transcripts, and OTLP GenAI exports, so you can hand it what your app already persists. - Requests are authenticated by workspace key; traces land in that workspace under
project. - The collectors retry failed batches (non-2xx / network errors) a couple of times, then drop them. Ingest is designed to never break the instrumented app.
