Manually log spans
Log individual or batched LLM calls to Respan via the Spans API — for custom pipelines without an SDK.
Use the Spans API to log individual LLM calls or batches directly over HTTP. This is useful for custom pipelines, languages without a Respan SDK, or one-off integrations. For SDK-based setup, see Set up the SDK. For existing OpenTelemetry setups, see OpenTelemetry (OTLP).
Spans API
Log individual spans directly using the Spans API. This is useful for logging LLM calls from custom pipelines.
See the full Spans API reference for all available fields.
Batch spans
Use POST /api/request-logs/bulk/ when you already have multiple completed calls to log. Wrap the same per-span objects accepted by the single-span endpoint in a logs array.
When the batch reaches per-row processing, the response reports accepted and rejected rows. Error indices are zero-based positions in the submitted logs array:
- Send between 1 and 500 spans per request.
- A full or partial success returns
201 Created. Always inspecterror_count; retry only the rows listed inerrors, because successful rows were already accepted. - A malformed or empty
logsarray, or a batch where every row fails, returns400 Bad Request. - More than 500 rows returns
422 Unprocessable Entitybefore any row is processed. - For API-key calls, the limit is 30 bulk requests per minute per organization, shared across all API keys. JWT calls are limited per user. Full 500-row batches provide a theoretical maximum of about 15,000 spans per minute. See API rate limits.
success_count means those rows passed synchronous validation and were accepted for ingestion. Storage is completed asynchronously.
For Lambda workloads, send events to a queue such as SQS or Kinesis and let a small consumer flush when it collects 500 rows or reaches a short time interval. This keeps ingestion latency out of the request path and makes retrying only failed indices straightforward.
See the full bulk spans API reference for the request and response schemas.