Getting Started
PayWeave gives you four ways to add MPP payments to your endpoints. Use one or combine them depending on your needs.
Apps
Apps let you add payment gating directly in your code using SDK middleware. Create an app in the PayWeave dashboard, get your credentials, and drop a one-line middleware into your Express, Fastify, Hono, or Next.js server.
Best for:
Full control over pricing logic, including dynamic per-request pricing.
Custom response handling and in-process payment verification with no extra network hop.
Gateways
Gateways are reverse proxies that sit in front of any upstream API and handle payment verification automatically. Configure them entirely from the PayWeave dashboard - no code changes to your upstream required.
Best for:
Monetizing third-party APIs you don't control.
Adding payments without touching application code.
Managing pricing from a UI.
Functions
Functions let you deploy serverless TypeScript handlers directly on PayWeave. Write code in the built-in editor, set a price per handler, and PayWeave hosts it - no infrastructure to manage.
Best for:
Building new paid APIs from scratch without deploying a server.
AI tool endpoints, data transformations, and lookup APIs.
Files
Files let you sell digital downloads with per-download pricing. Upload datasets, model weights, documents, or any file to a collection and set a price — agents pay via MPP and download directly.
Best for:
Selling datasets, ML models, research data, and digital goods.
Content that agents need to download and process locally.
Comparison
| Apps | Gateways | Functions | Files | |
|---|---|---|---|---|
| Code changes | Middleware per route | None | Write handler code | None |
| Pricing config | In code | Dashboard UI | Dashboard UI | Dashboard UI |
| Dynamic pricing | Per-request (function) | Per-endpoint | Per-handler | Per-file |
| Latency | In-process | +1 hop (proxy) | Managed (edge) | Streamed from R2 |
| Custom logic | Full control | None | Full control | None |
| Infrastructure | You manage | You manage upstream | Fully managed | Fully managed |
PayWeave