Skip to main content
POST
/
api
/
v1
/
events
Submit telemetry events
curl --request POST \
  --url https://api.agentmeter.com/api/v1/events \
  --header 'X-AgentMeter-Key: <api-key>'
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

{
  "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

{
  "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.