---
title: "Purchase usage credits"
method: POST
path: "/subscriptions/buy-credits"
tags: ["Subscriptions"]
---

# Purchase usage credits

`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

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

## Request body

- object
  - `appId` string, required
  - `packageId` string, required: Identifier of the credit package (e.g., ai-caller-500).
  - `priceId` string: Stripe price ID. Optional — resolved from appId + packageId + currency if omitted.
  - `credits` integer, required
  - `currency` string: Currency code for price resolution. Defaults to usd.
  - `successUrl` string, uri
  - `cancelUrl` string, uri
  - `metadata` object

## Response `200`

Checkout session created

- object
  - `success` boolean
  - `sessionId` string
  - `url` string, uri

## Other responses

- `401`: Missing or invalid authentication token
- `500`: Failed to create credit checkout session

---

[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)
