Project billing
What the calling project key's project cost your organization with the gateway (the provider cost of the requests on the platform's provider key), and whether its environments are let through.
Not your customers' wallets: those are Wallets. The organization's billing across its projects is the dashboard's.
| Operation | Method | SDK |
|---|---|---|
| Summarize the project's charges | GET | hixel.billing.summary |
| List the environments' standing | GET | hixel.billing.listStandings |
Summarize the project's charges#
GET/v1/billing/summaryhixel.billing.summary
What the project's usage cost the organization over [from, to) (at most 92 days), in all, by environment and by UTC day and environment..
Takes a project key with the admin role.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
from required | query | string (date-time) | The start of the range, included. |
to required | query | string (date-time) | The end of the range, excluded; at most 92 days after from. |
Response 200: ProjectBilling
| Field | Type | Description |
|---|---|---|
project_id required | string | The id of a project (proj_…). |
from required | string (date-time) | |
to required | string (date-time) | |
charged_micros required | string | Everything charged in the range, in micro-USD. |
requests required | string | How many requests were charged. |
environments required | array of object | Each environment charged in the range, archived ones included: the live one first, then by name. |
environments[].environment required | object | |
environments[].environment.id required | string | The id of an environment (env_…). |
environments[].environment.name required | string | |
environments[].environment.kind required | "live" | "test" | |
environments[].environment.archived required | boolean | |
environments[].charged_micros required | string | An amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number. |
environments[].requests required | string | An exact integer as a decimal string, such as "1250": never a JSON number, which cannot hold every integer exactly. |
days required | array of object | The charges by UTC day and environment, ascending. A day with no charge has no row. |
days[].day required | string | The UTC day, YYYY-MM-DD. |
days[].environment_id required | string | The id of an environment (env_…). |
days[].charged_micros required | string | An amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number. |
days[].requests required | string | An exact integer as a decimal string, such as "1250": never a JSON number, which cannot hold every integer exactly. |
token_spend_micros required | string | The metered token spend of every request that reached a provider in the range, at the deployments' provider prices before markup, whoever's provider key ran it, in micro-USD. |
token_spend required | array of object | The token spend by whose provider key ran the requests. |
token_spend[].credential required | "hixel" | "tenant" | "customer" | Whose provider key ran the requests: hixel (the platform's), tenant (your own) or customer (your customer's own key). |
token_spend[].spend_micros required | string | An amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number. |
token_spend[].requests required | string | An exact integer as a decimal string, such as "1250": never a JSON number, which cannot hold every integer exactly. |
token_spend_days required | array of object | The token spend by UTC day, environment and kind of key, ascending. A day with none has no row. |
token_spend_days[].day required | string | The UTC day the requests arrived, YYYY-MM-DD. |
token_spend_days[].environment_id required | string | The id of an environment (env_…). |
token_spend_days[].credential required | "hixel" | "tenant" | "customer" | Whose provider key ran the requests: hixel (the platform's), tenant (your own) or customer (your customer's own key). |
token_spend_days[].spend_micros required | string | An amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number. |
token_spend_days[].requests required | string | An exact integer as a decimal string, such as "1250": never a JSON number, which cannot hold every integer exactly. |
Errors
- 400
invalid_request: The request is malformed or fails validation;paramnames the field.invalid_range:frommust be beforeto, and a billing summary covers at most 92 days.invalid_query: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
- 401
api_key_required,invalid_api_key,expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired. - 403
key_inactive: the project key was revoked or expired while the request ran.project_key_required: an environment's key was sent; the project's endpoints take a project key.role_not_allowed: the project key'smemberrole does not allow this; it takesadmin.
- 500
internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned. - 503
database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
curl "https://api.hixel.dev/v1/billing/summary?from=2026-11-01T00%3A00%3A00Z&to=2026-12-01T00%3A00%3A00Z" \
-H "Authorization: Bearer $HIXEL_PROJECT_KEY"const projectBilling = await hixel.billing.summary({
from: "2026-11-01T00:00:00Z",
to: "2026-12-01T00:00:00Z",
});List the environments' standing#
GET/v1/billing/standingshixel.billing.listStandings
A page of whether each active environment of the project is let through: Production first, then the test ones, oldest first..
Takes a project key with the admin role.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
cursor | query | string | The next_cursor of the previous page, to read the next one; left out for the first page. Pass the same filters with it. |
limit | query | integer | How many items the page holds: an integer from 1 to 100; 50 when left out. |
Response 200: EnvironmentStandingList
| Field | Type | Description |
|---|---|---|
data required | array of EnvironmentStanding | |
data[].id required | string | The id of an environment (env_…). |
data[].name required | string | |
data[].kind required | "live" | "test" | |
data[].standing required | "good" | "depleted" | "suspended" | good: traffic flows. depleted: the organization's account with Hixel ran dry, and the gateway refuses every request (tenant_account_depleted, 402). suspended: Hixel stopped the environment (environment_suspended, 403). |
next_cursor required | string | null | Pass back as cursor for the next page; null on the last page. |
Errors
- 400
invalid_request: The request is malformed or fails validation;paramnames the field.invalid_cursor: The cursor is not one this list gave.invalid_query: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
- 401
api_key_required,invalid_api_key,expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired. - 403
key_inactive: the project key was revoked or expired while the request ran.project_key_required: an environment's key was sent; the project's endpoints take a project key.role_not_allowed: the project key'smemberrole does not allow this; it takesadmin.
- 500
internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned. - 503
database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
curl "https://api.hixel.dev/v1/billing/standings" \
-H "Authorization: Bearer $HIXEL_PROJECT_KEY"for await (const item of hixel.billing.listStandings()) {
console.log(item);
}