> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pylva.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit telemetry events

> Send batched cost telemetry from a Pylva SDK runtime with customer context, model usage, latency, and pricing-safe metadata.

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.

## Request

```json theme={null}
{
  "batch_id": "batch_01hxyz",
  "events": [
    {
      "trace_id": "trace_123",
      "span_id": "span_123",
      "timestamp": "2026-06-11T10:00:00.000Z",
      "customer_id": "cust_abc123",
      "step_name": "evaluate",
      "provider": "openai",
      "model": "gpt-4o-mini",
      "tokens_in": 1200,
      "tokens_out": 320,
      "latency_ms": 842,
      "status": "success"
    }
  ]
}
```

## Response

```json theme={null}
{
  "accepted": 1,
  "rejected": 0
}
```

The response can include validation errors, pricing warnings, and budget flags when applicable.

## Notes

* Cost is calculated server-side.
* Duplicate span IDs in a batch are ignored.
* 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.
