Ingest OTLP metrics (Bearer-authenticated)
Accepts one OTLP ExportMetricsServiceRequest (protobuf or its JSON mapping) and enqueues the agent usage it carries: token and cost counters from Claude Code (claude_code.token.usage, claude_code.cost.usage), Gemini CLI, Cursor and the OpenTelemetry GenAI conventions (gen_ai.client.token.usage). Only DELTA temporality is summed; a cumulative point, a metric family LastPing does not keep and a point with no usable value are counted in dropped and discarded, and the rest of the request is kept. A request adds at most 16 model series. A data point's own timestamp counts when it is within seven days before, or an hour after, the moment ingest received it; otherwise it counts at that moment.
Auth: exactly as POST /v1/traces: Authorization: Bearer lp_… with an unrevoked, unexpired key scoped ingest, write or admin, enforced unconditionally. lastping.monitor_id (a resource attribute) names the monitor, required unless the key is bound to one; a monitor outside the key's project is 404, the same as a monitor that does not exist.
Content-Type: application/x-protobuf or application/json (415 otherwise; gRPC is not accepted, so set OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf). Content-Encoding: gzip is accepted under the same size cap.
Caps: body ≤ 1 MiB decompressed (413 over); ≤ 500 data points per request (400 over). Rate limit: 3,600 requests/hour/project, its own bucket, separate from traces, logs and pings. Data points count against the project's daily span budget. Every label is redacted like a span attribute and stored up to 200 bytes.
Durability: 202 only after the enqueue succeeds; a queue failure is 503, never a silent ack. Metric sums are at-least-once: a request retried after a 503 may count twice.
Request
- Base URL: https://ping.lastping.dev
- URL: https://ping.lastping.dev/v1/metrics
- Auth: HTTP bearer
Request body
The OTLP JSON mapping of ExportMetricsServiceRequest.
Response
Accepted and enqueued.
Example response
{
"accepted": 3,
"dropped": 1
}Changes
No recorded changes to this operation across all 2 revisions of this API.