Subscriptions

Purchase usage credits

Create a Stripe Checkout session for purchasing additional AI credits or metered add-ons.

post/subscriptions/buy-credits

Request

  • Base URL: https://us-central1-paymentgateway-ab783.cloudfunctions.net/api
  • URL: https://us-central1-paymentgateway-ab783.cloudfunctions.net/api/subscriptions/buy-credits
  • Auth: HTTP bearer

Request body

appIdstring required
packageIdstring required

Identifier of the credit package (e.g., ai-caller-500).

priceIdstring

Stripe price ID. Optional — resolved from appId + packageId + currency if omitted.

creditsinteger required
currencystring

Currency code for price resolution. Defaults to usd.

successUrlstring uri
cancelUrlstring uri
metadataobject

Example request

{
  "appId": "ai-caller",
  "currency": "usd"
}

Response

Checkout session created

successboolean
sessionIdstring
urlstring uri

Changes

No recorded changes to this operation across all 1 revision of this API.