---
title: "Buy a bundle of API requests"
method: POST
path: "/api/payments/buy"
---

# Buy a bundle of API requests

`POST /api/payments/buy`

## Request

- Base URL: `https://api.reletter.com`
- URL: `https://api.reletter.com/api/payments/buy`
- Auth: none required

Pay-per-bundle purchase over HTTP 402 / Machine Payments Protocol (mpp.dev, IETF draft draft-ryan-httpauth-payment). POST with no `Authorization` header to receive a 402 carrying one `WWW-Authenticate: Payment` challenge per settlement method (`stripe`, `tempo`). Re-POST with `Authorization: Payment <base64url credential>` echoing the challenge to settle. On success the response body carries a ready-to-use API key bound to a freshly provisioned team; no signup involved. The price depends on the tier requested; see GET /api/payments/bundles for the live catalogue.

## Request body

- object
  - `quota` 5000 | 10000 | 25000 | 50000, required: Number of API requests to buy. Must be one of the tiers in GET /api/payments/bundles.
  - `recurring` boolean: Not currently supported; a credential presented with `recurring: true` is rejected with `recurring_not_supported`.

## Response `200`

Payment settled. Body carries the API key.

- object
  - `api_key` string: Send as the `x-reletter-api-key` header.
  - `api_key_header` string
  - `base_url` string
  - `quota` integer
  - `used` integer
  - `remaining` integer
  - `recurring` boolean
  - `expires_at` string, nullable
  - `bundle_id` integer
  - `payment_intent_id` string

## Other responses

- `400`: Body did not match the challenge, unknown tier, or recurring requested.
- `401`: Credential is malformed or does not echo a live challenge (`invalid_credential`).
- `402`: Payment Required

---

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