Option 1: API Key (Bearer Token)
Send your API key in theAuthorization header using the Bearer scheme.
Error Responses
| Status | Body | Cause |
|---|---|---|
| 401 | { "error": "Authorization header missing or malformed" } | No header or bad format |
| 401 | { "error": "API key missing" } | Empty key after Bearer |
| 401 | { "error": "Invalid API key" } | Key not found |
Option 2: Pay-Per-Request (MPP)
No API key needed. The Shoal API supports the Machine Payments Protocol (MPP) — an open standard for HTTP 402 pay-per-request access. Price: $0.01 per request, paid via Stripe (card or Link).How It Works
- Send a request with no
Authorizationheader (or withAuthorization: Payment ...) - The API returns
402 Payment Requiredwith aWWW-Authenticate: Paymentchallenge - Your client pays via Stripe and retries with the payment credential
- The API verifies payment and returns the response with a
Payment-Receiptheader
Quick Start
Use themppx CLI to test: