Skip to content
Start here

Topup

Create a top-up
client.aiGateway.billing.topup.create(TopupCreateParams { account_id, amount } params, RequestOptionsoptions?): TopupCreateResponse { client_secret, onboarding, payment_intent_id, 2 more }
POST/accounts/{account_id}/ai-gateway/billing/topup
Check top-up status
client.aiGateway.billing.topup.status(TopupStatusParams { account_id, payment_intent_id } params, RequestOptionsoptions?): TopupStatusResponse { payment_intent_id, status }
POST/accounts/{account_id}/ai-gateway/billing/topup/status
ModelsExpand Collapse
TopupCreateResponse { client_secret, onboarding, payment_intent_id, 2 more }
client_secret: string | null

Stripe PaymentIntent client secret.

onboarding: boolean

Whether the user was already onboarded.

payment_intent_id: string

Stripe invoice ID.

brand?: string

Card brand (visa, mastercard, etc.).

last4?: string

Last 4 digits of card.

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

TopupConfig

Get auto top-up configuration
client.aiGateway.billing.topup.config.get(ConfigGetParams { account_id } params, RequestOptionsoptions?): ConfigGetResponse { amount, disabledReason, error, 2 more }
GET/accounts/{account_id}/ai-gateway/billing/topup/config
Set auto top-up configuration
client.aiGateway.billing.topup.config.create(ConfigCreateParams { account_id, amount, threshold } params, RequestOptionsoptions?): ConfigCreateResponse { amount, threshold }
POST/accounts/{account_id}/ai-gateway/billing/topup/config
Delete auto top-up configuration
client.aiGateway.billing.topup.config.delete(ConfigDeleteParams { account_id } params, RequestOptionsoptions?): ConfigDeleteResponse
DELETE/accounts/{account_id}/ai-gateway/billing/topup/config
ModelsExpand Collapse
ConfigGetResponse { amount, disabledReason, error, 2 more }
amount: number | null
disabledReason: string | null
error: string | null
lastFailedAt: number | null
threshold: number | null
ConfigCreateResponse { amount, threshold }
amount: number
threshold: number
ConfigDeleteResponse = unknown