Skip to content
Start here

Topup

Create a top-up
POST/accounts/{account_id}/ai-gateway/billing/topup
Check top-up status
POST/accounts/{account_id}/ai-gateway/billing/topup/status
ModelsExpand Collapse
TopupCreateResponse object { client_secret, onboarding, payment_intent_id, 2 more }
client_secret: string

Stripe PaymentIntent client secret.

onboarding: boolean

Whether the user was already onboarded.

payment_intent_id: string

Stripe invoice ID.

brand: optional string

Card brand (visa, mastercard, etc.).

last4: optional string

Last 4 digits of card.

TopupStatusResponse object { payment_intent_id, status }
payment_intent_id: string
status: "completed" or "pending"
One of the following:
"completed"
"pending"

TopupConfig

Get auto top-up configuration
GET/accounts/{account_id}/ai-gateway/billing/topup/config
Set auto top-up configuration
POST/accounts/{account_id}/ai-gateway/billing/topup/config
Delete auto top-up configuration
DELETE/accounts/{account_id}/ai-gateway/billing/topup/config
ModelsExpand Collapse
ConfigGetResponse object { amount, disabledReason, error, 2 more }
amount: number
disabledReason: string
error: string
lastFailedAt: number
threshold: number
ConfigCreateResponse object { amount, threshold }
amount: number
threshold: number
ConfigDeleteResponse = unknown