List plans
const url = 'http://localhost:8080/v1/plans?limit=50&offset=0';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://localhost:8080/v1/plans?limit=50&offset=0' \ --header 'Authorization: Bearer <token>'Plans in the mode of your API key, newest first, each with its prices.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Rows per page, from 1 to 100. Default 50. Any other value, one that
is not a whole number, or limit sent twice is a 422 with
param: limit. It is never clamped.
Rows to skip, 0 or more. Default 0. A negative value, one that is
not a whole number, or offset sent twice is a 422 with
param: offset.
Responses
Section titled “Responses”One page of plans, and how many there are.
object
A plan is what a subscription buys: a recurring base fee and the
usage prices of its meters, in one currency and billing interval.
GET / lists plans in this shape. Get, create and update
answer a PlanDetail, which adds two fields.
object
The plan’s ID, hc_pln_ and 20 characters.
The account the plan belongs to.
Your short name for the plan. Letters, digits, - and _, at
most 100 characters, unique in the account and mode. Fixed
after create.
The plan’s display name. Create refuses one longer than 255 bytes (UTF-8); an update does not check the length.
ISO 4217 code in upper case, such as USD. Fixed after create.
The plan’s prices take it.
How often a subscription to the plan is billed. Fixed after create.
An archived plan takes no new subscriptions and no plan change onto it. Subscriptions already on it keep billing.
The recurring base fee per billing period, in the currency’s minor unit (cents for USD). 0 for a usage-only plan.
When the base fee is invoiced, relative to the period it
covers. in_: the base fee and the usage are billed at
the period end. in_: the base fee is billed at the
period start; the first invoice comes when the subscription
starts, and each cycle invoice carries the next period’s base
fee with the past period’s usage. Usage is always billed at
the period end. A plan with no base fee is in_.
The plan’s usage prices from now on, in the order they were added. A plan’s meters are the meters it has a price for.
One usage price of a plan: a meter, the events it takes
(dimension_) and its rate. The price takes the plan’s
currency. Its id stays the same when its rate changes; its meter
and dimension_ are its identity and never change. Every
shape field is always sent: the ones the mode does not use are
"0", 0 or [].
object
The price’s ID, hc_prc_ and 20 characters.
The account the price belongs to.
The plan the price belongs to.
The meter whose usage the price bills.
The labels an event must carry for this price to take it, for
example {"model": "claude-opus-4..
{} takes every event of the meter. Of the prices whose labels
an event carries, the one with the most labels takes it.
object
How the price bills a quantity; see PriceShape.
Price per unit, as a decimal string of cents. "0" unless mode
is per_.
Empty ([]) unless mode is graduated.
One tier of a graduated price.
object
The tier’s upper bound in whole units: the tier prices the quantity above the previous tier’s bound, up to this one. null on the last tier, which has no upper bound. Only the last tier is null, and it must be.
Price per unit in cents in this tier, as a decimal string. "0"
makes the tier free.
The units in one package. 0 unless mode is package.
Price of one package, as a decimal string of cents. "0" unless
mode is package.
When the price was first added to the plan.
When the content shown was saved.
Your description of the plan. Absent when empty.
A Stripe product tax code, such as txcd_, read only
by the Stripe Tax provider. Today only the base fee line of the
invoice billed when an in-advance subscription starts carries
it; cycle invoices and usage lines use the account’s
default_. Absent when not set.
When the plan was created.
When the plan was last changed.
How many rows match the request’s filters, on every page, not only this one. The audit log and the customer list’s search and name or email sort say where they stop counting.
Example
{ "data": [ { "id": "hc_pln_dajr5o2q3gpgqfoq5c1g", "tenant_id": "hc_ten_dajqj02q3gpgqfoq5c00", "code": "pro", "name": "Pro", "description": "Base fee plus metered tokens.", "currency": "USD", "billing_interval": "monthly", "status": "active", "base_amount_cents": 4900, "base_bill_timing": "in_arrears", "prices": [ { "id": "hc_prc_dajr672q3gpgqfoq5c20", "tenant_id": "hc_ten_dajqj02q3gpgqfoq5c00", "plan_id": "hc_pln_dajr5o2q3gpgqfoq5c1g", "meter_id": "hc_mtr_dajr122q3gpgqfoq5c10", "dimension_match": {}, "mode": "per_unit", "unit_amount_cents": "0.0003", "tiers": [], "package_size": 0, "package_amount_cents": "0", "created_at": "2026-09-15T09:05:00Z", "updated_at": "2026-09-15T09:05:00Z" } ], "created_at": "2026-09-15T09:05:00Z", "updated_at": "2026-09-15T09:05:00Z" } ], "total": 1}No valid credential: the API key or session is missing, wrong,
expired or revoked. With no API key and no valid session cookie, the
message starts with missing credentials. A wrong, expired and
revoked key all get the same message, invalid or expired API key.
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "authentication_error", "code": "unauthorized", "message": "invalid or expired API key", "request_id": "req_dbjg652q3gpgqfoq5cd0" }}The credential is valid but may not call this route. A usage-only
key (hc_) can only send usage, read a customer’s live
credit balance and call GET /; use a secret key. The message names the permission the key
lacks. A browser request that would change data (POST, PUT, PATCH
or DELETE) from a page on another site gets this 403 too, with the
message cross-site request blocked.
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "authentication_error", "code": "forbidden", "message": "insufficient permissions: this key type does not have customer:read access", "request_id": "req_dbjg652q3gpgqfoq5cd0" }}limit or offset is out of range, not a whole number or sent twice, or the request sends the removed after cursor (param names it)
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "invalid_request_error", "code": "validation_error", "message": "limit must be a whole number from 1 to 100", "request_id": "req_dbjg652q3gpgqfoq5cd0", "param": "limit" }}Too many requests. Wait for the number of seconds in Retry-After,
then retry. The answers that pass the limit carry the
X-RateLimit-* headers too.
Each API key has its own limit, by default 1,000 requests a minute
(HARDCOUNT_), and 1,000 a second on the
usage routes (HARDCOUNT_). The dashboard
sessions of one account share one limit per mode. The routes under
/ and / (sign-in, password reset, invite
accept, setup) count per client address, by default 100 a minute
(HARDCOUNT_). The public invoice,
payment-update and cost-dashboard pages allow 60 a minute per client
address.
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "rate_limit_error", "code": "rate_limited", "message": "too many requests — please retry after the rate limit resets", "request_id": "req_dbjg652q3gpgqfoq5cd0" }}Headers
Section titled “Headers”Example
12Seconds to wait before the next request can pass, rounded up to a whole second and at least 1.
Example
1000How many requests the limit allows in its period (a minute, or a second on the usage routes).
Example
0How many requests are left in the current period.
Example
1793870460When the whole limit is available again, as Unix seconds. One
request may pass sooner; Retry-After says when.
Stuck, or found a bug? Ask in Discussions · Open an issue