Earn revenue on
every AI request.

Charge users for every AI request, down to fractions of a cent. Collect payments automatically.

Replace flat-rate subscriptions with usage-based revenue. Your users pay for what they consume, and you earn on every request.

Start accepting payments in under a minute.

RequestYour costThey pay
A chat reply$0.012$0.018
An image$0.030$0.045
A long document$0.210$0.315
Your margin+$0.126
Example prices at 1.5× what the model cost. You pick the margin.

Bill for any model, from any provider.

Payfer never sits between you and your model. Keep calling Claude, OpenAI, fal.ai or your own API the way you do now, and add one server call that charges for each request.

charge()Fixed price

Charge a set price per request

When you know the price up front, like a flat rate per image or per reply, charge it in one call. No prompt, no card form.

server.ts
// The price is known before the work runs.
await payfer.charge({
  paymentUserId: user.paymentUserId,
  amount: "0.045",
  idempotencyKey: requestId,
});

const image = await generateImage(prompt);

meter()Priced by usage

Meter usage, then collect the exact price

For tokens, seconds or megapixels, reserve the most a request can cost, run it, and collect what it actually used. The rest is released.

server.ts
// Reserve the most it can cost, collect what it used.
const reply = await payfer.meter(
  { paymentUserId: user.paymentUserId, maxAmount: "0.05",
    idempotencyKey: requestId },
  async () => {
    const result = await generate(prompt);
    return { amount: priceOf(result.usage), value: result };
  },
);

One package, browser and server

A connect button in your app, one charge call on your server. Your sign-in, your providers and your interface stay exactly as they are.

Terminal
npm install payfer
In the browser
payfer in React, Vite or plain JavaScript
On your server
payfer/server in Node.js, with TypeScript types
Dependencies
None
Test mode
Test keys the moment you register an app

Price what a subscription can’t.

When a charge can be half a cent, every action in your app can carry its own price. Here’s what that opens up for AI products, with example prices.

  • Drop the bring-your-own-key step

    Skip the part where people go and get their own API key before they can try your app. They connect a Payfer balance in a few clicks and pay for what they run, while your key stays on your server.

  • Charge per image, and per second of video

    Generation costs swing from one request to the next. Price each one at your cost plus a margin, so a quick draft costs cents and a long render pays for itself.

  • Agents that pay as they work

    Charge from your server at each step of a long task, with no prompt in the way and nobody waiting at the screen. The monthly limit your user set keeps an agent from running up a bill.

  • Earn from people who’d never subscribe

    Someone who opens your app twice a month won’t buy a monthly plan, but they will pay for those two visits. Turn occasional visitors into revenue instead of losing them at the paywall.

  • Revenue from a side project on day one

    No plans, invoices or billing system to build. Register an app, add a connect button and charge from your server. Payfer takes no fee on your first $1,000.

  • Usage pricing beside your plan

    Keep your subscription and your sign-in for everyday use. Charge for the expensive extras, like a larger model or a long document, only when someone uses them.

Usage-based billing, answered.

What it costs, how your users pay, and what stays exactly the same in your app.

Free until your first $1,000.

After that, Payfer’s fee comes out of each charge and gets lower as your app grows.

Pricing and fees in the docs
TierLifetime charges per appFee per charge
FreeFirst $1,000 or 10,000 charges$0
GrowthNext $9,000 or 90,000 charges5% + $0.001
ScaleNext $90,000 or 900,000 charges2.5% + $0.0005
VolumeNext $900,000 or 9,000,000 charges1% + $0.0002
EnterpriseBeyond $1,000,000 or 10,000,000 chargesContact us
Each tier ends at its dollar amount or charge count, whichever comes first.

Frequently asked questions

What does Payfer cost?

Nothing on your first $1,000 or 10,000 charges. After that, Payfer’s fee comes out of each charge, from 5% + $0.001 down to 1% + $0.0002 as your app grows. Your users pay the card processing fee when they add funds.

What’s the smallest amount I can charge?

The minimum is $0.005. Above that you can price a request in fractions of a cent, down to six decimal places, so each charge can match what the request actually cost you.

How do my users pay?

They sign in with their email on Payfer’s page and choose a monthly limit. Someone new to Payfer adds their first month by card as they approve, from $5. That one balance then works in every app that uses Payfer.

Can a user be charged more than they agreed to?

No. Within each month, what you charge plus any open reservations stays inside the limit they approved, even with many requests running at once. Raising the limit needs their approval again, and they can lower or revoke it at any time.

Do I have to change my sign-in or my AI provider?

No. Payfer gives each connected user a payment ID that you store next to your own user record. Your sign-in, your model providers and your interface stay as they are.

What do I learn about the people who pay me?

A payment ID that’s different in every app. You don’t get their email address through Payfer, and you can’t see which other apps they use.

How do refunds work?

Refund all or part of any payment with one call. The refund is paid from your Payfer balance back to your user, and Payfer takes no fee on it.

Can I try it before going live?

Yes. Every app gets test keys the moment you register it, with test cards and the same flows your users will see. Go live from the dashboard in two steps when you’re ready.

Start earning on every request.

Test keys in under a minute. No fee on your first $1,000.