v52

latestOpenAPI 3.0.0raw.githubusercontent.com2026-08-03101355448.4 KB
OpenMeter Customers

List credit grants

List credit grants.

get/openmeter/customers/{customerId}/credits/grants

Path parameters

customerIdstring required

ULID (Universally Unique Lexicographically Sortable Identifier).

Example:01G65Z755AFWAKHE12NY0CQ9FH

Query parameters

sizeinteger

The number of items to include per page.

numberinteger

The page number.

Determines which page of the collection to retrieve.

status'pending' | 'active' | 'expired' | 'voided'

Credit grant lifecycle status.

  • pending: The credit block has been created but is not yet valid. (effective_at is in the future or availability_policy is not met)
  • active: The credit block is currently valid and eligible for consumption. (effective_at is in the past, expires_at is in the future and availability_policy is met)
  • expired: The credit block expired with remaining unused balance, expires_at time has passed.
  • voided: The credit block was voided. Remaining balance is forfeited.
currencystring

Three-letter ISO4217 currency code. Custom three-letter currency codes are also supported for convenience.

Filter credit grants returned in the response.

{
  "currency": "USD"
}

Response

Page paginated response.

Example response

{
  "data": [
    {
      "id": "01G65Z755AFWAKHE12NY0CQ9FH",
      "labels": {
        "env": "test"
      },
      "created_at": "2023-01-01T01:01:01.001Z",
      "updated_at": "2023-01-01T01:01:01.001Z",
      "deleted_at": "2023-01-01T01:01:01.001Z",
      "currency": "USD",
      "purchase": {
        "currency": "USD"
      },
      "tax_config": {
        "tax_code": {
          "id": "01G65Z755AFWAKHE12NY0CQ9FH"
        }
      },
      "invoice": {
        "id": "01G65Z755AFWAKHE12NY0CQ9FH",
        "line": {
          "id": "01G65Z755AFWAKHE12NY0CQ9FH"
        }
      },
      "filters": {
        "features": [
          "input_tokens",
          "output_tokens"
        ]
      },
      "effective_at": "2023-01-01T01:01:01.001Z",
      "key": "019ae40f-4258-7f15-9491-842f42a7d6ac",
      "expires_at": "2023-01-01T01:01:01.001Z",
      "voided_at": "2023-01-01T01:01:01.001Z"
    }
  ],
  "meta": {
    "page": {
      "number": 1,
      "size": 10,
      "total": 100
    }
  }
}