---
title: "Consume credits"
method: POST
path: "/credits/consume"
tags: ["Credits"]
---

# Consume credits

`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

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

## Request body

- object
  - `appId` string, required
  - `amount` number, required: Amount of credits to consume
  - `description` string, required: Description of what consumed the credits
  - `metadata` object: Additional metadata (call ID, duration, etc.)

## Response `200`

Credits consumed successfully

- object
  - `success` boolean
  - `balance` number: Remaining balance after consumption

## Other responses

- `400`: Insufficient credits
- `401`: Missing or invalid authentication token

---

[API](https://skmtc.dev/futuresenseai/apis/futuresense-ai-central-hub-api.md) · [All operations](https://skmtc.dev/futuresenseai/apis/futuresense-ai-central-hub-api/llms.txt) · [OpenAPI document](https://skmtc.dev/futuresenseai/apis/futuresense-ai-central-hub-api/revisions/53e075911af9?raw)
