comecerodocs

Get usage this period so far

GET
/usage/agreements/{agreement_id}/current

Used, included, percent and amount so far for each metered entitlement, worked out as the next bill will be, before prepaid credit. Kept for 5 minutes, so it can be a few minutes behind. Secret and trusted tokens may call it; a limited token may not (403).

Authorization

headerAuthorizationBearer <token>

A secret, trusted or limited token. See Authentication.

Path Parameters

agreement_id*string

The agreement id.

Response Body

Success.

application/json
  1. response
object?string

Always usage_period_so_far.

agreement_id?string

The agreement.

customer_id?string

Your id for the customer.

currency?string

The agreement's currency.

period_start?string

Start of the period not billed yet.

Formatdate-time
period_end?string

The subscription's next renewal, when known.

Formatdate-time
as_of?string

Usage is counted up to this hour.

Formatdate-time
entitlements?array<>

One line per metered entitlement.

Example Request
curl -X GET 'https://api.comecero.com/api/v1/usage/agreements/string/current'
Example Response
{  "object": "usage_period_so_far",  "agreement_id": "agr_cust_8412",  "customer_id": "cust_8412",  "currency": "USD",  "period_start": "2026-11-01T00:00:00Z",  "period_end": "2026-12-01T00:00:00Z",  "as_of": "2026-11-12T10:00:00Z",  "entitlements": [    {      "entitlement_id": "ent_cust_8412_ai_tokens",      "metric_id": "met_ai_tokens",      "metric_key": "ai_tokens",      "metric_name": "AI tokens",      "unit_label": "token",      "used": 830000,      "included": 1000000,      "percent": 83,      "amount": 0    }  ]}