ultra tier, a standard code review or live test starts at 60 credits for one target, then adds 20 credits for each additional repository or domain. A local-source-only code review therefore starts at 60 credits; uploading source does not make the scan free. Other scan tiers and full-audit engagements have different estimates, so treat the estimate returned for the request as authoritative.
If a non-Enterprise workspace cannot cover the estimate, scan creation returns HTTP 402 Payment Required with code scan_credit_limit_reached. The CLI maps this to exit code 5. The rejected request creates no scan and consumes no credits. Validation and plan rejections that occur before launch also consume no credits.
The 402 body tells the caller how to recover. It leads with a credit purchase that is sized to the rejected request:
credits_to_buyis the number of credits that the request needs above the current balance. Strix rounds it up to a whole credit and keeps it inside the top-up limits. When the route cannot estimate the request, the value is the default pack.price_usdis the price ofcredits_to_buycredits.checkout_urlis a hosted checkout link for exactlycredits_to_buycredits. Open it in a browser and pay. The field is present only when the token could callPOST /api/v1/billing/checkoutitself: the token hasbilling:write, has norbac_scopes, and belongs to an admin or is a service token. When the field is absent, thehintnames the billing page instead.hintis the one-line next step. The CLI prints it after the error.topup_optionslists the recovery paths in the order that a headless caller should try them. Each option contains the APImethodandpath, the matchingclicommand, and adescription. ThePOSToptions also contain the requestbodyto send.
also_run_now: true, and manual schedule triggers return the same body. Chat requests on the Cloud plan return the same body with code chat_credit_limit_reached when the wallet is empty. Chat rejections use the default pack for credits_to_buy and do not contain checkout_url. See Chat for how Chat uses credits.
The machine payment option (POST /api/v1/billing/topup) is for agents that hold a Stripe agent wallet. Callers without a wallet must skip it and use the hosted checkout.
When the workspace can still start the Cloud plan trial, the body also contains a plan_trial object after the top-up fields:
adds_scan_credits is always false. A caller that needs to run a scan must buy credits, not start the trial. The plan_trial object is present only when the workspace has not subscribed before, can still start the trial, and checkout would not charge the caller at once. When the object is present, the detail text also mentions the trial. Use plan as the product value for POST /api/v1/billing/checkout. Subscribers, former subscribers, and workspaces with an ended trial receive the plain top-up guidance.
Get the credit balance
billing:read
The response contains the current balance, chat_balance, and price_per_credit_cents. Scans reserve whole credits from balance. chat_balance gives the whole credits that Chat can still spend. It equals balance, or balance plus one while Chat holds the unspent part of a credit that it started to use. An Enterprise workspace may still have a wallet balance, but normal Enterprise scan launches and chats do not debit it.
Buy credits with a machine payment
This endpoint accepts agent payments through the Stripe Machine Payments Protocol (MPP). The purchase requires an admin role on the workspace.billing:write
Send the API token in the X-Strix-Authorization header for this endpoint. MPP uses the standard Authorization header for the payment credential.
The first request returns HTTP 402 Payment Required with a payment challenge in the WWW-Authenticate header. Pay the challenge with an MPP wallet, for example the Stripe Link agent wallet, and retry the request with the payment credential. See the Stripe machine payments documentation for wallet setup.
The challenge body also contains checkout_url and wallet_setup. checkout_url is a hosted checkout link for the same number of credits. It is present when the token could call POST /api/v1/billing/checkout itself. wallet_setup tells a caller without a wallet to open checkout_url and pay in the browser instead. The protocol headers of the challenge do not change.
reference. A retry with the same paid credential returns duplicate: true and grants no additional credits.
Get automatic top-up settings
billing:read
The response contains enabled, topup_credits, monthly_cap_credits, chat_cap_credits, and used_this_month.
Update automatic top-up settings
Automatic top-ups charge the saved payment method of the workspace when the balance runs out. Scan launches and Chat turns both trigger a top-up. The sametopup_credits and monthly_cap_credits apply to both. The chat_cap_credits limit applies to one chat. When the top-ups for a chat reach that limit, Strix pauses the chat instead of a new charge. Manual purchases and scans are not affected. The update requires an admin role on the workspace.
billing:write
Set monthly_cap_credits to null to remove the monthly limit. Set chat_cap_credits to null to remove the limit for one chat. An omitted field keeps the stored value.
An admin can also lift the per-chat limit for a single chat, without a change to the workspace limit. Use PUT /api/v1/chat/<CHAT_ID>/auto-topup-limit with {"lifted": true}. The monthly cap still applies to that chat. See Chat for the details.
Create a checkout link
Use this endpoint to buy a plan or a credit pack. The response contains a hosted checkout page. A person must open the page and complete the payment.billing:write
The accepted products are strix_cloud for the Cloud plan, strix_startup for an approved startup offer, and strix_top_up for a credit pack. The request needs an admin role on the workspace. The response contains checkout_url. The open-source CLI opens this page with the strix cloud billing subscribe --plan strix_cloud command.
Create a billing portal link
The billing portal shows the invoices of the workspace. A person can change the payment method and the plan there.billing:write
The request needs an admin role on the workspace. The response contains portal_url.
If the workspace does not yet have a billing customer, the endpoint returns HTTP 409 Conflict with instructions to subscribe first. Create a checkout link with the preceding endpoint, complete that handoff as a person, and then request the portal again. Provider failures return 502 Bad Gateway; an on-premises deployment where the hosted portal is unavailable returns 400 Bad Request.
The CLI equivalent is strix cloud billing portal. It prints or opens the hosted link; it never changes payment details by itself.
For machine-payment top-ups, strix cloud billing topup --credits <N> --no-pay prints the payment challenge without paying it. In an interactive terminal, the paying form asks for confirmation. In an agent, CI, or other non-interactive process, payment cannot proceed unless --yes is present; obtain the user’s approval before running strix cloud billing topup --credits <N> --yes. The --yes and --no-pay options are mutually exclusive. --yes authorizes the CLI to invoke the configured wallet, but Link may still require the user to approve or complete the payment.