---
title: "Buy Credits"
method: POST
path: "/credits/buy"
tags: ["Credits"]
---

# Buy Credits

`POST /credits/buy`

## Request

- Base URL: `https://api.weblens.dev`
- URL: `https://api.weblens.dev/credits/buy`
- Auth: API key in header `Payment-Signature`

Buy prepaid credits for WebLens API. Credits are used for all paid endpoints and offer bonuses at $10/$50/$100 tiers. Price: the amount you buy, $2-$1000.

## Request body

- object
  - `amount` number, required: Amount in USD to buy

## Response `200`

Prepay credits; deposit bonuses at $10 / $50 / $100.

- object
  - `success` boolean
  - `duplicate` boolean: True when this payment was already applied; nothing was added
  - `message` string
  - `added` string: Amount added, e.g. "$10.00"
  - `bonus` string: Deposit bonus accrued, e.g. "$2.00"
  - `newBalance` string: Balance after the deposit, e.g. "$12.0000"
  - `tier` string: standard, premium or enterprise
  - `requestId` string

## Other responses

- `400`: The body failed validation
- `402`: Payment required — x402 v2 protocol. Parse the PAYMENT-REQUIRED response header (base64-encoded JSON), sign the payment with your wallet, then retry the request with the Payment-Signature request header.

---

[API](https://skmtc.dev/weblens/apis/weblens-api.md) · [All operations](https://skmtc.dev/weblens/apis/weblens-api/llms.txt) · [OpenAPI document](https://skmtc.dev/weblens/apis/weblens-api/revisions/63a7e81b6921?raw)
