Billing API
Retrieve billing information and perform subscription actions such as creating a checkout session, enabling bring-your-own-key (BYOK) mode, checking usage, and purchasing credit packs.All billing endpoints require session authentication.
Get billing info
Response
Response fields
Errors
Billing actions
action field in the request body determines which operation is executed.
Create checkout session
Creates a Stripe checkout session for subscribing to a plan.Request body
Response
url to complete payment.
Errors
Enable BYOK
Enables bring-your-own-key mode with an external AI provider. When BYOK is active, AI requests are billed directly by the provider rather than consuming platform credits.Request body
Response
Errors
Disable BYOK
Disables BYOK mode and reverts to platform credits.Request body
Response
Get usage
Returns the current day’s unit consumption.Request body
Response
Buy credits
Purchases a credit pack.Request body
Response
Errors
Common errors
These apply to all billing POST actions:Subscription deploy
This is a backend-only endpoint that requires bearer token (API key) authentication.