Skip to content

Billing

Billing operations in the Hlix API.

Billing manages the workspace’s Hlix subscription, usage, orders, checkout and billing portal. For invoices an agency issues to its customers, see Client billing.

See the OpenAPI document for schemas and operation IDs.

  • Protected operations require an API key in x-api-key or a browser session cookie; some actions require a verified user session
  • Tenant-scoped operations use X-Organization-Id; browser sessions can use their active workspace. Discovery and personal-workspace bootstrap do not require an active workspace
  • The base URL for your deployment, https://server.hlix.ai by default
Method Path Operation
GET /v1/api/billing Read the workspace’s plan, credit, meters, orders and entitlement
POST /v1/api/billing/checkout Open a hlix billing checkout billed to the workspace
GET /v1/api/billing/extra-usage Read whether work may continue past the included usage
PUT /v1/api/billing/extra-usage Allow or stop usage past the included credit for the workspace
POST /v1/api/billing/portal Open the billing portal for the workspace
GET /v1/api/bonus-credits List the bonus credit actions and which are claimed
POST /v1/api/bonus-credits/{action}/claim Claim the bonus credit for one action
GET /v1/api/projects/{projectId}/extra-usage Read a project’s extra usage override and what it resolves to
PUT /v1/api/projects/{projectId}/extra-usage Set a project’s extra usage override
POST /v1/api/promotions/analytics-consent Withdraw stored promotion analytics permission
POST /v1/api/promotions/claim Claim an offer for the workspace
GET /v1/api/promotions/current Read the workspace’s current promotion
GET /v1/api/promotions/partner Read this partner’s referral counts and reward history
GET /v1/api/promotions/partners/{slug} Preview a public partner offer
POST /v1/api/promotions/resolve Preview a private invitation or public partner offer
GET /v1/api/usage Read workspace usage and entitlement
PATCH /v1/api/usage/delivery-limit Set or clear the monthly Delivery spending limit
DELETE /v1/api/usage/limit Clear the workspace usage limit
PUT /v1/api/usage/limit Set the workspace usage limit
GET /v1/api/usage/monthly-limits Read Growth and Delivery limits and spending this UTC month

Read the workspace’s plan, credit, meters, orders and entitlement

Section titled “Read the workspace’s plan, credit, meters, orders and entitlement”

GET /v1/api/billing · operation ID getOrgBilling

Parameters

Name In Required Type Description
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 OrgBillingState The workspace billing state and entitlement. configured: false confirms that no billing provider is configured. entitlement.kind distinguishes a full-access override, subscription, free tier, unconfigured provider and failed lookup. A failed lookup is not evidence that no subscription exists. credit is the plan credit of the period in Hlix Dollars (micros): the plan’s own credit, the credit carried in, what is used, what is left and the whole percent used; null when the plan states none (an unconfigured provider, a failed lookup or a full-access override). Display null as unavailable rather than zero.
400 ApiError The request named no active organization.
401 ApiError No valid session or API key.
403 ApiError Billing is agency-only — an external client collaborator may not read the agency’s plan or invoices.
404 ApiError The resource does not exist, or the caller is a task-scoped credential and this endpoint is outside its allowlist.
502 ApiError The billing provider did not answer. The workspace’s plan is unknown, not absent.

Open a hlix billing checkout billed to the workspace

Section titled “Open a hlix billing checkout billed to the workspace”

POST /v1/api/billing/checkout · operation ID createOrgBillingCheckout

Parameters

Name In Required Type Description
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Request body — application/json, BillingCheckout (required)

Property Type Required Notes
plan free | pro | business | scale yes
successUrl string (uri) no

Responses

Status Body Description
200 BillingCheckoutSession A Hlix billing checkout URL bound to the workspace as the billing customer. plan: "free" opens the US$0 Hlix-Free product so a workspace on the Free plan can add a payment method.
400 ValidationError | ApiError The JSON body failed schema validation (ValidationError), the request named no active organization, or no billing product is configured for the requested plan on this deployment (ApiError).
401 ApiError No valid session or API key.
403 ApiError Only workspace owners and admins may open a checkout or a customer portal.
404 ApiError The resource does not exist, or the caller is a task-scoped credential and this endpoint is outside its allowlist.
409 ApiError The workspace’s own state blocks the checkout — it has no member to bill, or the owner’s email is already the billing contact for another workspace and no per-workspace alias can be formed. Not retryable; the message names the change that would fix it.
502 ApiError The billing provider did not answer. The workspace’s plan is unknown, not absent.
503 ApiError Billing is not configured for this deployment.

Read whether work may continue past the included usage

Section titled “Read whether work may continue past the included usage”

GET /v1/api/billing/extra-usage · operation ID getOrgExtraUsage

Parameters

Name In Required Type Description
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 WorkspaceExtraUsage The resolved workspace setting, its source, and whether it can be turned on (it needs an active subscription).
400 ApiError The request named no active organization.
401 ApiError No valid session or API key.
403 ApiError Billing is agency-only — an external client collaborator may not read the agency’s plan or invoices.
404 ApiError The resource does not exist, or the caller is a task-scoped credential and this endpoint is outside its allowlist.
503 ApiError The workspace’s subscription could not be verified, so the setting’s effect is unknown. Nothing changed.

Allow or stop usage past the included credit for the workspace

Section titled “Allow or stop usage past the included credit for the workspace”

PUT /v1/api/billing/extra-usage · operation ID setOrgExtraUsage

Parameters

Name In Required Type Description
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Request body — application/json, SetExtraUsage (required)

Property Type Required Notes
allow boolean | null yes

Responses

Status Body Description
200 WorkspaceExtraUsage The resolved setting after the write. allow: null returns it to the plan’s default.
400 ValidationError | ApiError The JSON body failed schema validation (ValidationError), or the request named no active organization (ApiError).
401 ApiError No valid session or API key.
403 ApiError Only workspace owners and admins may change extra usage.
404 ApiError The resource does not exist, or the caller is a task-scoped credential and this endpoint is outside its allowlist.
409 ApiError Extra usage cannot be turned on: the workspace has no active subscription to charge (code: "payment_method_required"), the last payment failed and is not settled yet (code: "payment_failed"), or its usage is not metered (code: "not_metered"). Every plan, the free plan included, may turn it on once it has a way to pay. Turning it off always succeeds.
503 ApiError The workspace’s subscription could not be verified, so the setting’s effect is unknown. Nothing changed.

POST /v1/api/billing/portal · operation ID createOrgBillingPortal

Parameters

Name In Required Type Description
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 BillingPortalSession A billing portal URL for the workspace’s billing account, where its plan can be changed or cancelled and past invoices viewed.
400 ApiError The request named no active organization.
401 ApiError No valid session or API key.
403 ApiError Only workspace owners and admins may open a checkout or a customer portal.
404 ApiError The resource does not exist, or the caller is a task-scoped credential and this endpoint is outside its allowlist.
409 ApiError The workspace has no member to bill, or its billing email is unusable. Not retryable.
502 ApiError The billing provider did not answer. The workspace’s plan is unknown, not absent.
503 ApiError Billing is not configured for this deployment.

List the bonus credit actions and which are claimed

Section titled “List the bonus credit actions and which are claimed”

GET /v1/api/bonus-credits · operation ID listBonusCredits

Parameters

Name In Required Type Description
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 BonusActions Every action, claimed when this workspace or the signed-in person already claimed it, and the credit one claim adds.
400 ApiError The request named no active organization.
401 ApiError No valid session or API key.
403 ApiError Bonus credits are agency-only; an external client collaborator may not read or claim them.
404 ApiError The resource does not exist, or the caller is a task-scoped credential and this endpoint is outside its allowlist.

POST /v1/api/bonus-credits/{action}/claim · operation ID claimBonusCredit

Parameters

Name In Required Type Description
action path yes string
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 BonusClaim The credit was added: to this month’s free credit, or to the subscription’s usage credit for the current period.
400 ApiError The request named no active organization.
401 ApiError No valid session or API key.
403 ApiError Bonus credits are agency-only; an external client collaborator may not read or claim them.
404 ApiError No such bonus action.
409 ApiError This workspace or this person already claimed this action.
503 ApiError The billing provider did not confirm the credit. Nothing was claimed; try again.

Read a project’s extra usage override and what it resolves to

Section titled “Read a project’s extra usage override and what it resolves to”

GET /v1/api/projects/{projectId}/extra-usage · operation ID getProjectExtraUsage

Parameters

Name In Required Type Description
projectId path yes string
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 ProjectExtraUsage The project’s override (inherit, allow or block), its effective value and the setting that determined it.
400 ApiError The request named no active organization.
401 ApiError No valid session or API key.
403 ApiError Authenticated, but not a member of the named organization — or a client collaborator without the required access on this project.
404 ApiError No such project in this workspace.
503 ApiError The workspace’s subscription could not be verified, so the setting’s effect is unknown. Nothing changed.

PUT /v1/api/projects/{projectId}/extra-usage · operation ID setProjectExtraUsage

Parameters

Name In Required Type Description
projectId path yes string
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Request body — application/json, SetProjectExtraUsage (required)

Property Type Required Notes
mode inherit | allow | block yes

Responses

Status Body Description
200 ProjectExtraUsage The resolved project setting after the write. The project’s override wins over the workspace setting.
400 ValidationError | ApiError The JSON body failed schema validation (ValidationError), or the request named no active organization (ApiError).
401 ApiError No valid session or API key.
403 ApiError Project settings are agency-only, and only owners and admins may change extra usage.
404 ApiError No such project in this workspace.
409 ApiError Extra usage cannot be turned on: the workspace has no active subscription to charge (code: "payment_method_required"), the last payment failed and is not settled yet (code: "payment_failed"), or its usage is not metered (code: "not_metered"). Every plan, the free plan included, may turn it on once it has a way to pay. Turning it off always succeeds.
503 ApiError The workspace’s subscription could not be verified, so the setting’s effect is unknown. Nothing changed.

Withdraw stored promotion analytics permission

Section titled “Withdraw stored promotion analytics permission”

POST /v1/api/promotions/analytics-consent · operation ID revokePromotionAnalyticsConsent

Authentication — A signed-in user session is required. API keys cannot authenticate this operation. Browsers send the session cookie automatically; server clients preserve the complete issued Cookie header.

Parameters

Name In Required Type Description
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Request body — application/json, PromotionAnalyticsConsent (required)

Property Type Required Notes
granted boolean yes

Responses

Status Body Description
200 PromotionConsentRevoked Stored analytics associations were cleared.
400 ValidationError | ApiError The JSON body failed schema validation (ValidationError), or the request named no active organization (ApiError).
401 ApiError No valid session or API key.
403 ApiError Authenticated, but not a member of the named organization — or a client collaborator without the required access on this project.
404 ApiError The resource does not exist, or the caller is a task-scoped credential and this endpoint is outside its allowlist.
503 ApiError The offer or billing authority is temporarily unavailable.

POST /v1/api/promotions/claim · operation ID claimPromotionOffer

Parameters

Name In Required Type Description
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Request body — application/json, PromotionResolveInput (required)

Property Type Required Notes
code string no min length 3, max length 128
partnerSlug string no min length 3, max length 40

Responses

Status Body Description
200 PromotionCurrent The frozen workspace offer.
400 ValidationError | ApiError The JSON body failed schema validation (ValidationError), or the request named no active organization (ApiError).
401 ApiError No valid session or API key.
403 ApiError Authenticated, but not a member of the named organization — or a client collaborator without the required access on this project.
404 ApiError The link or code is invalid, expired or unavailable.
409 ApiError The offer conflicts with existing customer eligibility or reached its claim limit.
503 ApiError The offer or billing authority is temporarily unavailable.

GET /v1/api/promotions/current · operation ID getCurrentPromotion

Parameters

Name In Required Type Description
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 PromotionCurrent The workspace’s promotion or null.
400 ApiError The request named no active organization.
401 ApiError No valid session or API key.
403 ApiError Authenticated, but not a member of the named organization — or a client collaborator without the required access on this project.
404 ApiError The resource does not exist, or the caller is a task-scoped credential and this endpoint is outside its allowlist.
503 ApiError The offer or billing authority is temporarily unavailable.

Read this partner’s referral counts and reward history

Section titled “Read this partner’s referral counts and reward history”

GET /v1/api/promotions/partner · operation ID getOwnPartnerPromotion

Parameters

Name In Required Type Description
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 PromotionPartnerSummary Aggregated partner referrals and the beneficiary’s grant.
400 ApiError The request named no active organization.
401 ApiError No valid session or API key.
403 ApiError Authenticated, but not a member of the named organization — or a client collaborator without the required access on this project.
404 ApiError The resource does not exist, or the caller is a task-scoped credential and this endpoint is outside its allowlist.
503 ApiError The offer or billing authority is temporarily unavailable.

GET /v1/api/promotions/partners/{slug} · operation ID getPartnerPromotionOffer

Authentication — Public; no API key or session required.

Parameters

Name In Required Type Description
slug path yes string

Responses

Status Body Description
200 PromotionOffer The partner and offer.
400 ApiError The request named no active organization.
401 ApiError No valid session or API key.
403 ApiError Authenticated, but not a member of the named organization — or a client collaborator without the required access on this project.
404 ApiError The link or code is invalid, expired or unavailable.
409 ApiError The offer conflicts with existing customer eligibility or reached its claim limit.
503 ApiError The offer or billing authority is temporarily unavailable.

Preview a private invitation or public partner offer

Section titled “Preview a private invitation or public partner offer”

POST /v1/api/promotions/resolve · operation ID resolvePromotionOffer

Authentication — Public; no API key or session required.

Request body — application/json, PromotionResolveInput (required)

Property Type Required Notes
code string no min length 3, max length 128
partnerSlug string no min length 3, max length 40

Responses

Status Body Description
200 PromotionOffer The offer and plan-fee quotes with complete H$ allowances.
400 ValidationError | ApiError The JSON body failed schema validation (ValidationError), or the request named no active organization (ApiError).
401 ApiError No valid session or API key.
403 ApiError Authenticated, but not a member of the named organization — or a client collaborator without the required access on this project.
404 ApiError The link or code is invalid, expired or unavailable.
409 ApiError The offer conflicts with existing customer eligibility or reached its claim limit.
503 ApiError The offer or billing authority is temporarily unavailable.

GET /v1/api/usage · operation ID getWorkspaceUsage

Parameters

Name In Required Type Description
sinceDays query no string Usage window in days; defaults to 30.
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 WorkspaceUsage Usage in the requested day window, default 30 days. Amounts are the price of the usage (cost plus markup), what the workspace is charged, in Hlix Dollars (micros). vectors splits the charge into models, machines and storage with the parts under each; credit is the plan credit left.
400 ApiError The request named no active organization.
401 ApiError No valid session or API key.
403 ApiError Usage is agency-only.
404 ApiError The resource does not exist, or the caller is a task-scoped credential and this endpoint is outside its allowlist.

Set or clear the monthly Delivery spending limit

Section titled “Set or clear the monthly Delivery spending limit”

PATCH /v1/api/usage/delivery-limit · operation ID setDeliveryMonthlyLimit

Parameters

Name In Required Type Description
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Request body — application/json, DeliveryMonthlyLimit (required)

Property Type Required Notes
deliveryMonthlyCapMicros integer (int64) | null yes

Responses

Status Body Description
200 DeliveryMonthlyLimit Stored cap in USD micros; null removes the limit.
400 ValidationError Invalid limit.
401 ApiError No valid session or API key.
403 ApiError Owner or admin required.
404 ApiError The resource does not exist, or the caller is a task-scoped credential and this endpoint is outside its allowlist.

DELETE /v1/api/usage/limit · operation ID removeWorkspaceUsageLimit

Parameters

Name In Required Type Description
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 UsageLimitResponse The usage limit is cleared.
400 ApiError The request named no active organization.
401 ApiError No valid session or API key.
403 ApiError Owner or admin required.
404 ApiError The resource does not exist, or the caller is a task-scoped credential and this endpoint is outside its allowlist.

PUT /v1/api/usage/limit · operation ID setWorkspaceUsageLimit

Parameters

Name In Required Type Description
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Request body — application/json, UsageLimit (required)

Property Type Required Notes
capMillicents integer yes max 9007199254740991

Responses

Status Body Description
200 UsageLimitResponse Stored limit in millicents.
400 ValidationError Invalid limit.
401 ApiError No valid session or API key.
403 ApiError Owner or admin required.
404 ApiError The resource does not exist, or the caller is a task-scoped credential and this endpoint is outside its allowlist.

Read Growth and Delivery limits and spending this UTC month

Section titled “Read Growth and Delivery limits and spending this UTC month”

GET /v1/api/usage/monthly-limits · operation ID getMonthlySpendLimits

Parameters

Name In Required Type Description
X-Organization-Id header no string The workspace (organization) to act in. Omitted, the session’s active organization is used.

Responses

Status Body Description
200 MonthlySpendLimits Both categories share workspace credit.
400 ApiError The request named no active organization.
401 ApiError No valid session or API key.
403 ApiError Usage is agency-only.
404 ApiError The resource does not exist, or the caller is a task-scoped credential and this endpoint is outside its allowlist.

The response table for each operation lists its documented errors. Common status codes include:

  • 400 — the body failed schema validation, or the request named no active organization. A ValidationError body carries the failing fields; an ApiError body carries only error.
  • 401 — no valid session or API key.
  • 403 — authenticated, but not a member of the named organization, or a client collaborator without the required access.
  • 404 — check the resource ID and your access to the selected Workspace.
  • 409 — the expected revision or state is stale, or another operation currently owns the transition.
  • 500 — the operation failed server-side. Retry only where an idempotency key makes that safe.