Documentation menu

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.

OperationMethodSDK
Summarize the project's chargesGEThixel.billing.summary
List the environments' standingGEThixel.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

NameInTypeDescription
from requiredquerystring (date-time)The start of the range, included.
to requiredquerystring (date-time)The end of the range, excluded; at most 92 days after from.

Response 200: ProjectBilling

FieldTypeDescription
project_id requiredstringThe id of a project (proj_…).
from requiredstring (date-time)
to requiredstring (date-time)
charged_micros requiredstringEverything charged in the range, in micro-USD.
requests requiredstringHow many requests were charged.
environments requiredarray of objectEach environment charged in the range, archived ones included: the live one first, then by name.
environments[].environment requiredobject
environments[].environment.id requiredstringThe id of an environment (env_…).
environments[].environment.name requiredstring
environments[].environment.kind required"live" | "test"
environments[].environment.archived requiredboolean
environments[].charged_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
environments[].requests requiredstringAn exact integer as a decimal string, such as "1250": never a JSON number, which cannot hold every integer exactly.
days requiredarray of objectThe charges by UTC day and environment, ascending. A day with no charge has no row.
days[].day requiredstringThe UTC day, YYYY-MM-DD.
days[].environment_id requiredstringThe id of an environment (env_…).
days[].charged_micros requiredstringAn amount of micro-USD (millionths of a US dollar) as a decimal string: "1500000" is 1.50 USD. Never a JSON number.
days[].requests requiredstringAn exact integer as a decimal string, such as "1250": never a JSON number, which cannot hold every integer exactly.
token_spend_micros requiredstringThe 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 requiredarray of objectThe 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 requiredstringAn 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 requiredstringAn exact integer as a decimal string, such as "1250": never a JSON number, which cannot hold every integer exactly.
token_spend_days requiredarray of objectThe token spend by UTC day, environment and kind of key, ascending. A day with none has no row.
token_spend_days[].day requiredstringThe UTC day the requests arrived, YYYY-MM-DD.
token_spend_days[].environment_id requiredstringThe 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 requiredstringAn 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 requiredstringAn 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; param names the field.
    • invalid_range: from must be before to, 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's member role does not allow this; it takes admin.
  • 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"

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

NameInTypeDescription
cursorquerystringThe next_cursor of the previous page, to read the next one; left out for the first page. Pass the same filters with it.
limitqueryintegerHow many items the page holds: an integer from 1 to 100; 50 when left out.

Response 200: EnvironmentStandingList

FieldTypeDescription
data requiredarray of EnvironmentStanding
data[].id requiredstringThe id of an environment (env_…).
data[].name requiredstring
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 requiredstring | nullPass back as cursor for the next page; null on the last page.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names 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's member role does not allow this; it takes admin.
  • 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"