Billing
Billing covers your plan, subscription, invoices, payment methods and usage, and what you may host and at what price. It also manages the Jaah AI wallet: its balance, top-ups, auto-recharge and ledger.
Get billing
Returns the organization's billing state: whether billing is connected, its billing details, subscription, any checkout in progress, the next charge and open billing notices. When the payment provider is unreachable, `details` is empty and the next charge reports `available: false`. Requires the Org Owner or Org Admin role.
Cancel subscription
Schedules a downgrade to the Trial plan at the end of the current billing period, undoable until then; an unpaid plan ends at once and an unfinished first payment is abandoned. Returns the updated subscription state, or 409 when there is no plan. Requires the Org Owner or Org Admin role.
Change subscription
Moves the organization to another plan. An upgrade is charged now, prorated, at the amount of an earlier preview named by `preview_id` (422 without one); a cheaper plan takes effect at period end, and `trial` downgrades at period end, or at once for an unpaid plan. Requires the Org Owner or Org Admin role.
Abandon checkout
Abandons an unfinished first payment for a paid plan; the organization stays on Trial. Returns the updated subscription state. Requires the Org Owner or Org Admin role.
Update billing details
Replaces the organization's billing name, email, address and tax ID, creating its billing customer record on first use. Returns the saved details. Requires the Org Owner or Org Admin role.
List invoices
Lists up to 100 of the organization's invoices, newest first, with amounts, status (including refunds), credit notes and document links. Returns an empty list when billing is not connected. Requires the Org Owner or Org Admin role.
Pay invoice
Pays an open invoice now with the organization's default card. Returns the invoice status, plus a client secret when the bank asks for 3D Secure; another organization's invoice returns 404. Requires the Org Owner or Org Admin role.
List billing notices
Lists the organization's open billing notices, such as a failed payment or an expiring card, newest first. Requires the Org Owner or Org Admin role.
List payment methods
Lists the organization's saved payment methods, the default first. Returns an empty list when billing is not connected. Requires the Org Owner or Org Admin role.
Delete payment method
Removes a saved payment method, first promoting another card to default when needed. With `dry_run=1`, reports whether the delete would be refused and which method would become the default, without changing anything; a refused delete returns 409. Requires the Org Owner or Org Admin role.
Update payment method
Changes a saved card's expiry date, cardholder name or billing address; the card number cannot change, and a past expiry returns 422. Returns the updated payment method. Requires the Org Owner or Org Admin role.
Set default payment method
Makes a saved payment method the default that pays invoices and lets a failed Jaah AI auto-recharge run again; an expired card returns 422. Returns all payment methods. Requires the Org Owner or Org Admin role.
Preview subscription change
Quotes what buying or moving to a plan costs now and at the next renewal, with line items. Returns a `preview_id` that an upgrade must name once, within 10 minutes, to be charged exactly this amount; `trial` returns 422. Requires the Org Owner or Org Admin role.
List hostings
Returns the organization's hostings, newest first: what each one is, whether it is a dedicated host, a shared node or a trial, how it is billed, its monthly price, the date it is paid until, its status (pending payment, active, past due, stopped, cancelling or terminated), when a cancelled one ends, and the actions open to it. Requires the Org Owner or Org Admin role.
Create setup intent
Starts saving a new payment method and returns the client secret the browser payment form uses to collect the card, including any 3D Secure step. Rate limited per user and per organization. Requires the Org Owner or Org Admin role.
Subscribe to a plan
Buys a paid plan, charged to the organization's default card; no usable card returns 422 and an existing plan returns 409. A decline returns 402 with the bank's reason, and a first payment awaiting 3D Secure returns a client secret to complete it. Requires the Org Owner or Org Admin role.
Sync billing
Refreshes the organization's payment methods, subscription and open invoices from the payment provider at once, and makes the newest usable card the default when none is set. Returns the payment methods. Requires the Org Owner or Org Admin role.
Undo subscription change
Cancels a scheduled downgrade or cancellation, keeping the current plan. Returns the updated subscription state. Requires the Org Owner or Org Admin role.
Get billing usage
Returns the organization's Jaah-hosted node usage for the current billing period: each node's minutes, hourly rate and estimated cost, plus the payment provider's forecast of those charges on this period's invoice. The total reports `available: false` when it cannot be fetched. Requires the Org Owner or Org Admin role.
Get Jaah AI wallet
Returns the organization's Jaah AI balance, the balance at which work pauses, the low-balance alert, mode, auto-recharge settings, prices, recent top-ups and recent ledger entries. Requires the Org Owner or Org Admin role.
Set Jaah AI auto-recharge
Turns auto-recharge on or off with its threshold and amount, and returns the wallet; turning it on without a default card or below the pause point returns 422. Saving clears the hold left by a failed recharge and, in `jaah` mode, charges the card at once when the balance is already at or below the threshold. Requires the Org Owner or Org Admin role.
Get Jaah AI ledger
Lists the organization's Jaah AI ledger between `from` and `to`, newest first, each day's usage folded into one row. Pages with `limit` and the `before` and `before_id` values of the previous page's last row. Requires the Org Owner or Org Admin role.
Set Jaah AI low-balance threshold
Sets the balance at which the organization gets a low-balance alert; a value below the pause point returns 422. Returns the wallet. Requires the Org Owner or Org Admin role.
Set Jaah AI mode
Switches the organization between running work on the Jaah AI account (`jaah`) and on its own agent accounts (`own`), and returns the wallet. Switching to `jaah` needs a balance above the pause point or a default card, and every refusal to switch returns 409. Requires the Org Owner or Org Admin role.
Refund a Jaah AI top-up
Refunds up to the unspent paid credit to the cards that paid it, returning the amount refunded, why any remainder was not, and the wallet. Returns 422 while auto-recharge is on or when the refund is refused, and 409 while another refund runs; a refused refund moves nothing. Requires the Org Owner or Org Admin role.
Top up the Jaah AI wallet
Charges a saved card `amount_micros` to add Jaah AI credit; the balance rises a few seconds later, once the payment is confirmed. A decline returns 402 and adds nothing; a bank 3D Secure check returns a client secret. Requires the Org Owner or Org Admin role.
Get Jaah AI usage
Returns the organization's Jaah AI spend and usage between `from` and `to`, grouped by task, epic, project, user or model, with a total and a daily series cut in the `tz` time zone. Requires the Org Owner or Org Admin role.
Get organization plan
Returns the caller's organization plan, the plan catalogue with prices, and each plan limit with current usage. Open to any organization member; subscription details appear only for Org Owners, Org Admins and members allowed to view finance.
Choose plan
Selects the Trial plan and returns the organization plan; paid plans are bought with a subscription, so any other plan returns 422. Records only the first choice. Requires the Org Owner or Org Admin role.
Get hosting catalog
Returns what the organization may host and at what price: whether each way to host (a dedicated host monthly or hourly, a shared node) is offered and, when not, why; the offered instance types, storage sizes and shared tiers with their monthly prices; the hourly price of each instance type, null when it cannot be hosted hourly; the saved default card; and the recommended way to add a node. Requires the Org Owner or Org Admin role.
Delete hosting
Deletes a hosting now: its machine is removed and the unused days of a monthly hosting are credited on the next invoice. Returns the hosting. Requires the Org Owner or Org Admin role.
Cancel hosting
Cancels a monthly hosting at renewal: it keeps running until the end of the month already paid, nothing more is billed for it, and it then stops. Returns the hosting. Requires the Org Owner or Org Admin role.
Resume hosting
Resumes a hosting: a cancelled one is kept, and one stopped by a cancellation or the end of a trial is charged a full month now (default card, or `payment_method_id`) and started; when the bank asks to confirm, `payment` carries the client secret and you call again once confirmed. A hosting stopped for non-payment resumes only by paying its open invoice (409). Requires the Org Owner or Org Admin role.
Undo hosting cancellation
Keeps a hosting that was cancelled at renewal, as long as its paid month has not ended. Returns the hosting. Requires the Org Owner or Org Admin role.