Credits

Consume credits

Deduct credits from user's balance. Typically called by app backends, not frontend.

post/credits/consume

Request

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

Request body

appIdstring required
amountnumber required

Amount of credits to consume

descriptionstring required

Description of what consumed the credits

metadataobject

Additional metadata (call ID, duration, etc.)

Example request

{
  "appId": "ai-caller",
  "description": "AI call - 5 minutes"
}

Response

Credits consumed successfully

successboolean
balancenumber

Remaining balance after consumption

Changes

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