comecerodocs

Get a customer's usage this period

GET
/customers/{customer_id}/usage

Each of the customer's plans billed by use: used, included and percent per metric, what the next bill comes to so far (amount_so_far), when the allowance starts again (reset_at), the prepaid credit left (credit) and, when your shop sells credit, what the customer may buy (buy_credit), and, when your shop uses spending limits, the subscription's limit (spend_limit). No prices per metric. A shopper's token reads only its own customer (me works). With usage billing turned off, data is empty. Here customer_id is the Comecero customer id, not your own id. Kept for 5 minutes.

Authorization

headerAuthorizationBearer <token>

A secret, trusted or limited token. See Authentication.

Path Parameters

customer_id*string

The Comecero customer id, or me.

Response Body

Success.

application/json
  1. response
object?string

Always list.

data?array<>

One entry per active plan billed by use on the customer's subscriptions, at most 20.

Example Request
curl -X GET 'https://api.comecero.com/api/v1/customers/string/usage'
Example Response
{  "object": "list",  "data": [    {      "object": "customer_usage",      "subscription_id": "SB0123456789",      "plan_name": "Team plan",      "currency": "USD",      "amount_so_far": "12.5",      "period_start": "2026-11-01T00:00:00Z",      "period_end": "2026-12-01T00:00:00Z",      "reset_at": "2026-12-01T00:00:00Z",      "as_of": "2026-11-12T10:00:00Z",      "metrics": [        {          "metric_name": "AI tokens",          "unit_label": "token",          "used": 830000,          "included": 1000000,          "percent": 83        }      ],      "credit": {        "balance": "37.5",        "expiry": null,        "at_zero": "charge"      },      "buy_credit": {        "presets": [          "10",          "25"        ],        "min": "5",        "max": "100",        "at_zero": "charge"      },      "spend_limit": {        "object": "usage_spend_limit",        "subscription_id": "SB0123456789",        "currency": "USD",        "amount": "50",        "default": null,        "effective": "50",        "source": "customer",        "spent": "12.5",        "committed": "0",        "remaining": "37.5",        "reset_at": "2026-12-01T00:00:00Z",        "customer_can_set": true,        "revision": 1      }    }  ]}