Levain LabsLevain Labs
ApiBilling

Create Topup

Start a credit top-up.

Start a credit top-up.

Returns a client secret to confirm the payment in the browser; the credit is added to the workspace balance once the payment settles. An invoice (with a downloadable PDF) is issued for every top-up and appears under GET /api/v1/billing/invoices.

POST
/api/v1/billing/topup

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Header Parameters

X-API-Key?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://api.levainlabs.com/api/v1/billing/topup" \  -H "Content-Type: application/json" \  -d '{    "amount_usd_cents": 100  }'
{
  "client_secret": "string",
  "invoice_id": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}