---
title: "Top up credits"
method: POST
path: "/billing/topup"
tags: ["billing"]
---

# Top up credits

`POST /billing/topup`

## Request

- Base URL: `https://www.dench.com/api/v1`
- URL: `https://www.dench.com/api/v1/billing/topup`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Create an AI credit top-up checkout link.

## Request body

- object
  - `requestId` string, required: Idempotency key (1-200 of [A-Za-z0-9:_-]).
  - `amountUsd` number, required: USD amount, $5 to $1000.

## Response `200`

Successful response

- union
  - object: Saved card charged directly.
    - `charged` true, required
    - `amountCents` number, required
  - object: Stripe Checkout link to complete the top-up.
    - `url` string, nullable, required

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid authentication
- `404`: Operation or resource not found
- `500`: Server error

---

[API](https://skmtc.dev/dench/apis/dench-api.md) - [All operations](https://skmtc.dev/dench/apis/dench-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dench/apis/dench-api/revisions/4a145b38f19c?raw)
