comecerodocs

Read counted usage

GET
/usage/summary

What the usage meter has counted for one customer and metric, by hour, before it is billed. from and to are moved to the start of their hour. Kept for 5 minutes. Secret and trusted tokens may call it; a limited token may not (403).

Authorization

headerAuthorizationBearer <token>

A secret, trusted or limited token. See Authentication.

Query Parameters

customer_id*string

Your id for the customer.

metric_key*string

The metric's event_key.

from*string

A date, from the start of its hour.

to*string

A date, not included. At most 366 days after from.

Response Body

Success.

application/json
  1. response
object?string

Always usage_summary.

customer_id?string

Your id for the customer.

metric_key?string

The metric's event key.

from?string

Start, from the start of its hour.

Formatdate-time
to?string

End, not included.

Formatdate-time
aggregation?string

The metric's aggregation.

Value in"sum""gauge"
value?number

The total for sum, the highest hour for gauge.

events?integer

Events counted.

complete?boolean

true once to is at least 15 minutes ago.

hours?array<>

Per hour: hour, value, events.

Example Request
curl -X GET 'https://api.comecero.com/api/v1/usage/summary?customer_id=string&metric_key=string&from=string&to=string'
Example Response
{  "object": "usage_summary",  "customer_id": "cust_8412",  "metric_key": "ai_tokens",  "from": "2026-11-01T00:00:00Z",  "to": "2026-11-02T00:00:00Z",  "aggregation": "sum",  "value": 1250000,  "events": 412,  "complete": true,  "hours": [    {      "hour": "2026-11-01T09",      "value": 52000,      "events": 18    }  ]}