> This page is for version Preview (default).
> For other versions, use one of these documentation indexes:
> - Preview (default): https://docs.preview.paid.ai/preview/llms.txt
> - Current: https://docs.preview.paid.ai/current/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.preview.paid.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.preview.paid.ai/_mcp/server.

# Per-request pricing for an infrastructure API

> A search API prices each request by endpoint with a rate card, gives developers a free monthly allowance in credits, and signs a high-volume customer at a discount that grows with volume.

Proseware sells a web search API to AI agents. It has three endpoints, each priced per 1,000 requests: search at \$5, answer at \$10 and deep research at \$25. New developers get 10,000 free credits a month to try it. Tailspin Research, its biggest customer, has signed a discount that grows with the number of requests it sends.

This example uses:

* [Products](../../api-reference/catalog/products/create) and [meters](../../api-reference/metering/meters/create)
* [Rate cards](/catalog/rate-cards), in preview
* [Credit currencies](../../api-reference/catalog/credit-currencies/create) and a [price](../../api-reference/catalog/prices/create) that grants credits, for the free tier
* [Customers](../../api-reference/customers/customers/create) and [orders](../../api-reference/billing/orders/create), with negotiated pricing
* [Events](../../api-reference/metering/events/create)

> **Note**
>
> The calls below show only the request body. Every request also sends the `Authorization` and `Paid-Version` headers, and a `Paid-Beta` header opting in to the betas these endpoints require: `products=v1`, `meters=v1`, `rate_cards=v1`, `credits=v1`, `prices=v1`, `customers=v1`, `orders=v1` and `events=v1`. Writes should also send an `Idempotency-Key`. See [request headers](../../api-reference/introduction#request-headers) and [idempotency](../../api-reference/idempotency).

## Set up the catalog \[#set-up-the-catalog]

These calls run once.

[Create a product](../../api-reference/catalog/products/create) for the API:

**`POST /v1/products`**

```json title="POST /v1/products"
{
  "externalId": "search_api",
  "name": "Search API"
}
```

[Create a meter](../../api-reference/metering/meters/create) that counts requests and groups them by endpoint, so each endpoint can have its own price:

**`POST /v1/meters`**

```json title="POST /v1/meters"
{
  "key": "requests",
  "name": "Requests",
  "eventNames": ["api_request"],
  "measure": {
    "type": "events",
    "events": {
      "aggregation": { "type": "count" },
      "unit": "request",
      "groupBy": ["payload.endpoint"]
    }
  }
}
```

Set up two [rate cards](/catalog/rate-cards) on the `requests` meter, one rate per endpoint. The rate card API is in preview. `search_api` charges paying customers in dollars, and `search_api_credits` charges the free tier in credits, at 1 credit to \$0.001:

| Rate     | Endpoint | `search_api`, per 1,000 requests | `search_api_credits`, per request |
| -------- | -------- | -------------------------------- | --------------------------------- |
| `search` | `search` | \$5.00                           | 5 credits                         |
| `answer` | `answer` | \$10.00                          | 10 credits                        |
| `deep`   | `deep`   | \$25.00                          | 25 credits                        |

## Give developers a free tier \[#free-tier]

[Create a credit currency](../../api-reference/catalog/credit-currencies/create) for the free credits. With no `conversion`, requests past a developer's credits are recorded as overage but never billed:

**`POST /v1/credit-currencies`**

```json title="POST /v1/credit-currencies"
{
  "key": "proseware_credits",
  "name": "Proseware credits",
  "conversion": null
}
```

[Create a price](../../api-reference/catalog/prices/create) for the free tier. It costs nothing, and grants 10,000 credits each month that expire at the end of it:

**`POST /v1/prices`**

```json title="POST /v1/prices"
{
  "product": "search_api",
  "name": "Free tier",
  "displayName": "Proseware free tier",
  "currency": "usd",
  "type": "recurring",
  "recurring": {
    "interval": "month",
    "pricing": { "type": "perUnit", "perUnit": { "unitAmount": "0" } },
    "grants": [
      {
        "creditCurrency": "proseware_credits",
        "amountPerUnit": "10000",
        "grantedOn": "activation",
        "expiresAfter": { "value": "1", "unit": "month" }
      }
    ]
  }
}
```

This returns `prc_freeTier01`. When a developer signs up, [create the customer](../../api-reference/customers/customers/create) and an [order](../../api-reference/billing/orders/create) with the free tier price and the credits rate card:

**`POST /v1/customers`**

```json title="POST /v1/customers"
{
  "externalId": "dev_7c21",
  "name": "Priya Raman",
  "email": "priya@example.com",
  "currency": "usd"
}
```

**`POST /v1/orders`**

```json title="POST /v1/orders"
{
  "customer": "dev_7c21",
  "startsAt": "2026-12-01T00:00:00Z",
  "billingCycle": { "interval": "month" },
  "lines": [
    { "type": "price", "price": { "price": "prc_freeTier01" } },
    {
      "type": "rateCard",
      "rateCard": { "rateCard": "search_api_credits" }
    }
  ]
}
```

An order with a rate card line is activated when you create it, so there is no separate activate call. Each month, Paid grants 10,000 credits, and every request spends from them: 2,000 searches use the whole allowance. To stop serving a developer who has used it, read their [credit balance](../../api-reference/credits/credit-balances/list) before serving a request. This is a soft limit: requests checked at the same time can all see credits left, so a developer can go a little past the allowance, and with no `conversion` that overage is never billed.

## Sign Tailspin at volume \[#sign-tailspin]

[Create the customer](../../api-reference/customers/customers/create):

**`POST /v1/customers`**

```json title="POST /v1/customers"
{
  "externalId": "tailspin",
  "name": "Tailspin Research",
  "currency": "usd"
}
```

Tailspin's discount depends on its total requests in the month. The bands are graduated: each band's percentages apply only to the requests inside it.

| Requests in the month | Search     | Answer     | Deep       |
| --------------------- | ---------- | ---------- | ---------- |
| 0 to 1M               | 5% off     | 10% off    | 15% off    |
| 1M to 5M              | 8% off     | 12% off    | 20% off    |
| Above 5M              | List price | List price | List price |

[Create the order](../../api-reference/billing/orders/create) with the `search_api` rate card, and the discount as negotiated pricing. `basis` names the meter whose total picks the band:

**`POST /v1/orders`**

```json title="POST /v1/orders"
{
  "customer": "tailspin",
  "externalId": "tailspin-2027",
  "startsAt": "2026-12-01T00:00:00Z",
  "endsAt": "2027-12-01T00:00:00Z",
  "billingCycle": { "interval": "month" },
  "lines": [
    { "type": "rateCard", "rateCard": { "rateCard": "search_api" } }
  ],
  "negotiatedPricing": [
    {
      "key": "request_volume",
      "type": "discount",
      "target": { "type": "rateCard", "rateCard": { "rateCard": "search_api" } },
      "displayName": "Contracted volume discount",
      "discount": {
        "type": "bandedPercentage",
        "bandedPercentage": {
          "mode": "graduated",
          "basis": { "meter": "requests", "measure": "requests" },
          "bands": [
            {
              "upTo": "1000000",
              "targets": [
                { "target": { "type": "rate", "rate": { "rateCard": "search_api", "rate": "search" } }, "percentOff": "5" },
                { "target": { "type": "rate", "rate": { "rateCard": "search_api", "rate": "answer" } }, "percentOff": "10" },
                { "target": { "type": "rate", "rate": { "rateCard": "search_api", "rate": "deep" } }, "percentOff": "15" }
              ]
            },
            {
              "upTo": "5000000",
              "targets": [
                { "target": { "type": "rate", "rate": { "rateCard": "search_api", "rate": "search" } }, "percentOff": "8" },
                { "target": { "type": "rate", "rate": { "rateCard": "search_api", "rate": "answer" } }, "percentOff": "12" },
                { "target": { "type": "rate", "rate": { "rateCard": "search_api", "rate": "deep" } }, "percentOff": "20" }
              ]
            },
            {
              "upTo": null,
              "targets": [
                { "target": { "type": "rate", "rate": { "rateCard": "search_api", "rate": "search" } }, "percentOff": "0" },
                { "target": { "type": "rate", "rate": { "rateCard": "search_api", "rate": "answer" } }, "percentOff": "0" },
                { "target": { "type": "rate", "rate": { "rateCard": "search_api", "rate": "deep" } }, "percentOff": "0" }
              ]
            }
          ]
        }
      }
    }
  ]
}
```

## Send usage \[#send-usage]

Proseware [sends an event](../../api-reference/metering/events/create) for every request, with the endpoint in the payload. The request ID is the `dedupeKey`, so a retried send is not counted twice:

**`POST /v1/events`**

```json title="POST /v1/events"
{
  "eventName": "api_request",
  "customer": "tailspin",
  "product": "search_api",
  "dedupeKey": "req_5d1e9a",
  "payload": { "endpoint": "search" }
}
```

At this volume, [send a batch](../../api-reference/metering/events/create-batch) of up to 1,000 events at a time.

## Tailspin's first month \[#tailspins-first-month]

In December, Tailspin sends 3.2 million requests: 2 million searches, 800,000 answers and 400,000 deep research requests, in the same mix every day. The first 1 million fall in the first band and the other 2.2 million in the second:

| Endpoint  | Requests      | List price      | First band               | Second band                | Discount       |
| --------- | ------------- | --------------- | ------------------------ | -------------------------- | -------------- |
| Search    | 2,000,000     | \$10,000.00     | 625,000 at 5%: \$156.25  | 1,375,000 at 8%: \$550.00  | \$706.25       |
| Answer    | 800,000       | \$8,000.00      | 250,000 at 10%: \$250.00 | 550,000 at 12%: \$660.00   | \$910.00       |
| Deep      | 400,000       | \$10,000.00     | 125,000 at 15%: \$468.75 | 275,000 at 20%: \$1,375.00 | \$1,843.75     |
| **Total** | **3,200,000** | **\$28,000.00** |                          |                            | **\$3,460.00** |

The invoice shows each endpoint at list price, \$28,000.00, then a "Contracted volume discount" line of −\$3,460.00. **Amount due: \$24,540.00.**

## A free-tier developer's month \[#free-tier-month]

In the same month, Priya sends 1,000 searches, 400 answers and 60 deep research requests: 5,000 + 4,000 + 1,500 = 10,500 credits against her 10,000. The last 500 credits are recorded as overage and never billed, and her invoice is \$0.00.

## Next steps

* [Migrations](/core-concepts/introduction-to-pricing#migrations): publish a new version of a rate card, such as search priced by speed, and move orders onto it.
* [Credit balances and ledger](/credits/credit-ledger): what a developer has left, and every spend.