Skip to main content
The SDK sends batched telemetry events to this endpoint. Direct use is possible, but the SDK is recommended because it handles batching, retries, context propagation, and rule interactions.

Authentication

Send your API key in X-Pylva-Key. Rate limit: 1000 requests/min per key, shared with the other telemetry endpoints.

Request

The SDK sends this wire shape automatically. If you call the endpoint directly, use the full event shape below. Every event field is required - nullable is not the same as omittable. Send explicit null for fields you do not use; a partial event is rejected with 400 VALIDATION_ERROR. schema_version is the literal string "1.6". The batch envelope takes 1-100 events.

Event fields

The authoritative schema is api.pylva.com/openapi.json. Summary:

Response

Per-event semantic failures reject only the offending events and report them in errors[] of a 200 response:
The response can also include warnings entries of { "event_index": 0, "code": "needs_pricing_input" } (codes: needs_pricing_input, pending_pricing, customer_limit_reached) and budget_exceeded flags when a budget rule fired.

Notes

  • Cost is calculated server-side.
  • Do not send cost_usd; Pylva prices the event after ingest.
  • Duplicate span IDs in a batch - or already ingested recently - are dropped silently and counted in neither accepted nor rejected, so retrying a batch after a network failure is safe.
  • Events with unknown pricing can be accepted and surfaced as pricing setup tasks.
  • Do not include prompts, completions, raw messages, emails, or API keys in event metadata.