Gateway
The v1 gateway routes incoming requests to registered plugins. It supports dual payment methods — Stripe (existing) and MPP (Machine Payments Protocol) via the Tempo blockchain.Base URL
Request
Headers
Body
Additional body fields are forwarded to the target plugin.
Plugins
The gateway routes to the following plugins:generate-text is the default plugin when no plugin ID is specified.Authentication
Protected plugins require either a valid session (cookie-based via NextAuth) or a verified MPP payment credential. If you pay with MPP, session authentication is not required.Payment flow
The gateway supports two payment methods per request:- Stripe — Default. Requires an active subscription or credits. See Stripe integration.
- MPP — Crypto-native payments on the Tempo blockchain. See MPP payments.
X-Payment-Methodheader (mpporstripe)- Presence of an
Authorization: Paymentheader (impliesmpp) - Default:
stripe
MPP 402 challenge
When an MPP request has no valid credential, the gateway returns402 Payment Required with pricing information for both payment methods:
WWW-Authenticate header is also set:
Response
Success (200)
Payment-Receipt header and the payment.receipt field contains the transaction hash.
Response headers
Error responses
CORS
The gateway supports CORS preflight viaOPTIONS /api/v1/gateway. Allowed methods are POST and OPTIONS. The Authorization, Content-Type, X-Plugin-Id, and X-Payment-Method headers are permitted.