comecerodocs

List an agreement's billing runs

GET
/usage/agreements/{agreement_id}/runs

Newest period first. For the next page, set before to the oldest period_start you got. 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.

Query Parameters

before?string

An ISO 8601 date or time: only runs whose period_start is before it. One without an offset (a date only, or a time with no zone) is UTC. A value that is not a date is ignored.

limit?integer

1 to 100, default 25.

Response Body

Success.

application/json
  1. response
data?array<>

The list.

has_more?boolean

true when there is another page.

Example Request
curl -X GET 'https://api.comecero.com/api/v1/usage/agreements/string/runs'
Example Response
{  "data": [    {      "object": "billing_run",      "billing_run_id": "billing_run:agr_cust_8412:2026-11-01T00:00:00Z",      "billing_agreement_id": "agr_cust_8412",      "period_start": "2026-11-01T00:00:00Z",      "period_end": "2026-12-01T00:00:00Z",      "kind": "period",      "status": "completed",      "invoice_id": "IN0123456789",      "carried_forward": false,      "prepared_lines": [        {          "kind": "usage",          "name": "AI tokens (token): 500000 used, 1 Nov 2026 00:00 to 1 Dec 2026 00:00 UTC",          "quantity": 500000,          "rated_amount": 8,          "credit_debit": 5,          "capped_amount": 0,          "amount": 3        }      ],      "failure_code": null,      "failure_message": null,      "billing_region": "us",      "test": false    },    {      "object": "billing_run",      "billing_run_id": "billing_run:agr_cust_8412:2026-10-01T00:00:00Z",      "billing_agreement_id": "agr_cust_8412",      "period_start": "2026-10-01T00:00:00Z",      "period_end": "2026-11-01T00:00:00Z",      "kind": "period",      "status": "completed",      "invoice_id": "IN0123456788",      "carried_forward": false,      "prepared_lines": [        {          "kind": "usage",          "name": "AI tokens (token): 650000 used, 1 Oct 2026 00:00 to 1 Nov 2026 00:00 UTC",          "quantity": 650000,          "rated_amount": 10.4,          "credit_debit": 6,          "capped_amount": 4.4,          "amount": 0        },        {          "kind": "usage",          "name": "API calls (request): 25000 used, 1 Oct 2026 00:00 to 1 Nov 2026 00:00 UTC",          "quantity": 25000,          "rated_amount": 2.5,          "credit_debit": 0,          "capped_amount": 0,          "amount": 2.5        }      ],      "failure_code": null,      "failure_message": null,      "billing_region": "us",      "test": false    }  ],  "has_more": false}