K8 HQ

Organization billing — K8 HQ Setup API

Organization billing operations for K8 HQ Setup API. Requests, permissions and responses.

Version 1OpenAPI description (JSON)

Browse operation groups

Before making requests, read the authentication and request requirements.

Who pays for an organization, the fallback payer, and caps on what agents may spend each month.

Base URL

Base URLFor
https://api.k8hq.com/setupThe K8 HQ web app, and programs acting with a person's session

Endpoints

Organization billing

Read an explicit monthly agent spending cap

GET/v1/organizations/{orgId}/billing/agent-budget

Only a current, unsuspended human organization Owner can use this control. Apps, administrators and billing.pay gain no financial authority. Caps are finite exact unsigned decimal USD strings with at most nine fractional digits and int64 nanodollar bounds. Zero permits no positive charge; absent caps deny chargeable agent work. A credential cap must fit within the current organization cap. Credential targets resolve to an immutable personal credential or refresh-family subject, shared across access-token rotation. Atomic board mutations are the first financial admission consumer; other chargeable workflows remain held. These human Owner controls remain separate from spending.limit.self, an explicitly declared, Owner-approved and personally acknowledged own-cap grant implemented only behind the external-agent feature gates. Legacy credentials and broad administration gain no financial authority. Publication and activation remain held. Holds stay assigned to their original UTC month until confirmed settlement. The response distinguishes an unset cap from explicit zero.

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.

Parameters

NameTypeDescription
orgId (path) requiredstringThe exact orgId target.

Response body (JSON)

FieldTypeDescription
explicit requiredboolean
version requiredinteger
amountUSDstringPattern: ^[0-9]+(\.[0-9]{1,9})?$.

Responses

StatusBodyMeaning
200AgentBudgetCapThe explicit cap, or explicit=false and version=0 when unset.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed; Allow identifies supported methods.
409application/problem+jsonCurrent Owner authority or organization lifecycle changed; recapture before retrying.
410application/problem+jsonCurrent Owner authority or organization lifecycle changed; recapture before retrying.
503application/problem+jsonA temporary problem (unavailable); retry.

Configure an explicit monthly agent spending cap

PUT/v1/organizations/{orgId}/billing/agent-budget

Only a current, unsuspended human organization Owner can use this control. Apps, administrators and billing.pay gain no financial authority. Caps are finite exact unsigned decimal USD strings with at most nine fractional digits and int64 nanodollar bounds. Zero permits no positive charge; absent caps deny chargeable agent work. A credential cap must fit within the current organization cap. Credential targets resolve to an immutable personal credential or refresh-family subject, shared across access-token rotation. Atomic board mutations are the first financial admission consumer; other chargeable workflows remain held. These human Owner controls remain separate from spending.limit.self, an explicitly declared, Owner-approved and personally acknowledged own-cap grant implemented only behind the external-agent feature gates. Legacy credentials and broad administration gain no financial authority. Publication and activation remain held. Holds stay assigned to their original UTC month until confirmed settlement.

Needs a passkey confirmation of this change (x-k8hq-confirm: agent_budget.change). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused. The session needs a recent passkey: if its last passkey confirmation is more than 5 minutes old, the answer is 401 step_up_required.

Parameters

NameTypeDescription
orgId (path) requiredstringThe exact orgId target.
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail).

Request body (JSON)

FieldTypeDescription
amountUSD requiredstringPattern: ^[0-9]+(\.[0-9]{1,9})?$.

Response body (JSON)

FieldTypeDescription
explicit requiredboolean
version requiredinteger
amountUSDstringPattern: ^[0-9]+(\.[0-9]{1,9})?$.

Responses

StatusBodyMeaning
200AgentBudgetCapThe explicit cap, or explicit=false and version=0 when unset.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed; Allow identifies supported methods.
409application/problem+jsonCurrent Owner authority or organization lifecycle changed; recapture before retrying.
410application/problem+jsonCurrent Owner authority or organization lifecycle changed; recapture before retrying.
503application/problem+jsonA temporary problem (unavailable); retry.

Read an explicit monthly agent spending cap

GET/v1/organizations/{orgId}/billing/agent-budget/credentials/{credentialId}

Only a current, unsuspended human organization Owner can use this control. Apps, administrators and billing.pay gain no financial authority. Caps are finite exact unsigned decimal USD strings with at most nine fractional digits and int64 nanodollar bounds. Zero permits no positive charge; absent caps deny chargeable agent work. A credential cap must fit within the current organization cap. Credential targets resolve to an immutable personal credential or refresh-family subject, shared across access-token rotation. Atomic board mutations are the first financial admission consumer; other chargeable workflows remain held. These human Owner controls remain separate from spending.limit.self, an explicitly declared, Owner-approved and personally acknowledged own-cap grant implemented only behind the external-agent feature gates. Legacy credentials and broad administration gain no financial authority. Publication and activation remain held. Holds stay assigned to their original UTC month until confirmed settlement. The response distinguishes an unset cap from explicit zero.

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.

Parameters

NameTypeDescription
orgId (path) requiredstringThe exact orgId target.
credentialId (path) requiredstringThe exact credentialId target.

Response body (JSON)

FieldTypeDescription
explicit requiredboolean
version requiredinteger
amountUSDstringPattern: ^[0-9]+(\.[0-9]{1,9})?$.

Responses

StatusBodyMeaning
200AgentBudgetCapThe explicit cap, or explicit=false and version=0 when unset.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session, it expired, or it isn't a person's own session (unauthenticated).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed; Allow identifies supported methods.
409application/problem+jsonCurrent Owner authority or organization lifecycle changed; recapture before retrying.
410application/problem+jsonCurrent Owner authority or organization lifecycle changed; recapture before retrying.
503application/problem+jsonA temporary problem (unavailable); retry.

Configure an explicit monthly agent spending cap

PUT/v1/organizations/{orgId}/billing/agent-budget/credentials/{credentialId}

Only a current, unsuspended human organization Owner can use this control. Apps, administrators and billing.pay gain no financial authority. Caps are finite exact unsigned decimal USD strings with at most nine fractional digits and int64 nanodollar bounds. Zero permits no positive charge; absent caps deny chargeable agent work. A credential cap must fit within the current organization cap. Credential targets resolve to an immutable personal credential or refresh-family subject, shared across access-token rotation. Atomic board mutations are the first financial admission consumer; other chargeable workflows remain held. These human Owner controls remain separate from spending.limit.self, an explicitly declared, Owner-approved and personally acknowledged own-cap grant implemented only behind the external-agent feature gates. Legacy credentials and broad administration gain no financial authority. Publication and activation remain held. Holds stay assigned to their original UTC month until confirmed settlement.

Needs a passkey confirmation of this change (x-k8hq-confirm: agent_budget.change). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused. The session needs a recent passkey: if its last passkey confirmation is more than 5 minutes old, the answer is 401 step_up_required.

Parameters

NameTypeDescription
orgId (path) requiredstringThe exact orgId target.
credentialId (path) requiredstringThe exact credentialId target.
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail).

Request body (JSON)

FieldTypeDescription
amountUSD requiredstringPattern: ^[0-9]+(\.[0-9]{1,9})?$.

Response body (JSON)

FieldTypeDescription
explicit requiredboolean
version requiredinteger
amountUSDstringPattern: ^[0-9]+(\.[0-9]{1,9})?$.

Responses

StatusBodyMeaning
200AgentBudgetCapThe explicit cap, or explicit=false and version=0 when unset.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required).
403application/problem+jsonThey may not do this in the organization, or a browser origin other than the web app's (forbidden).
405application/problem+jsonMethod not allowed; Allow identifies supported methods.
409application/problem+jsonCurrent Owner authority or organization lifecycle changed; recapture before retrying.
410application/problem+jsonCurrent Owner authority or organization lifecycle changed; recapture before retrying.
503application/problem+jsonA temporary problem (unavailable); retry.

Change the fallback

PUT/v1/organizations/{orgId}/billing/fallback

Turns the payer's fallback on or off and sets its chunk and monthly cap. Only the payer can: it's their own balance. Every owner is told.

Needs a passkey confirmation of this change (x-k8hq-confirm: billing.fallback). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused. The session needs a recent passkey: if its last passkey confirmation is more than 5 minutes old, the answer is 401 step_up_required.

Parameters

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail).
orgId (path) requiredstringorgId resource identifier.

Request body (JSON)

FieldTypeDescription
fallback requiredFallback
{"fallback":{"cap":20,"chunk":1,"on":true}}

Response body (JSON)

FieldTypeDescription
fallback requiredFallback
orgId requiredstringThe organization (org_...). Pattern: ^org_.

Responses

StatusBodyMeaning
200JSONThe fallback as stored.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required).
403application/problem+jsonThey don't pay for it (not_payer), or aren't an owner.
405application/problem+jsonMethod not allowed. The Allow header lists supported methods.
409application/problem+jsonBilling changed meanwhile: look again.
410application/problem+jsonThe organization is being deleted (org_closed).
503application/problem+jsonA temporary problem (unavailable); retry.

Offer billing to another owner

POST/v1/orgs/payer/offer

The payer offers to hand billing to another owner, who accepts within 7 days with /v1/orgs/payer/take. They're told.

Needs a passkey confirmation of this change (x-k8hq-confirm: payer.change). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.

Parameters

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail).

Request body (JSON)

FieldTypeDescription
memberId requiredstringA member (mem_...). Pattern: ^mem_.
orgId requiredstringThe organization (org_...). Pattern: ^org_.
{"memberId":"mem_01J...","orgId":"org_01J..."}

Response body (JSON)

FieldTypeDescription
offerTo requiredstringA member (mem_...). Pattern: ^mem_.
orgId requiredstringThe organization (org_...). Pattern: ^org_.

Responses

StatusBodyMeaning
200JSONOffered.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required).
403application/problem+jsonThey don't pay for it (not_payer), or the member isn't an owner (owner_only).
409application/problem+jsonBilling changed meanwhile: look again.
410application/problem+jsonThe organization is being deleted (org_closed).
503application/problem+jsonA temporary problem (unavailable); retry.

Take over billing

POST/v1/orgs/payer/take

An owner becomes the organization's payer, with their own funding: accepting the payer's offer, or taking billing over (design note 0004 section 4). The fallback is off until they turn theirs on; the old payer's unused purchased credit goes back to them. Every owner is told.

Needs a passkey confirmation of this change (x-k8hq-confirm: payer.change). Until confirmations are enforced, a passkey sign-in in the last five minutes also works.

For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.

Parameters

NameTypeDescription
x-amz-content-sha256 (header) requiredstringThe body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail).

Request body (JSON)

FieldTypeDescription
orgId requiredstringThe organization (org_...). Pattern: ^org_.
{"orgId":"org_01J..."}

Response body (JSON)

FieldTypeDescription
orgId requiredstringThe organization (org_...). Pattern: ^org_.

Responses

StatusBodyMeaning
200JSONThey pay for it now.
400application/problem+jsonMalformed or invalid input (invalid).
401application/problem+jsonNo session or it expired, or isn't a person's own (unauthenticated); or its passkey confirmation is more than 5 minutes old (step_up_required).
403application/problem+jsonOnly an owner can pay for an organization (owner_only).
409application/problem+jsonBilling changed meanwhile: look again (conflict); or a new payer pays for 3 organizations already, the most while they're new (new_payer_orgs).
410application/problem+jsonThe organization is being deleted (org_closed).
503application/problem+jsonA temporary problem (unavailable); retry.