Documentation Index
Fetch the complete documentation index at: https://docs.monkepay.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Required
apiKeyId
Type: string
Your MonkePay API key ID. Get this from the dashboard under API Keys.
apiKeySecret
Type: string
Your MonkePay API key secret. Used to sign requests to the MonkePay API. Never log or commit this.
price
Type: string
Price per request in USDC. The $ prefix is optional.
0.000001 (1 atomic USDC unit). Maximum: 1000000.
Optional
paymentMode
Type: 'per_request' | 'one_time'
Default: 'per_request'
Controls how agents are charged. See Payment Modes for full details.
per_request— every request requires paymentone_time— agent pays once, receives an unlock token granting permanent access to that endpoint
unlockHeaderName
Type: string
Default: 'X-MonkePay-Unlock'
The header name used to pass the one-time unlock token. Only relevant when paymentMode is 'one_time'. Change this if the default conflicts with your existing headers.
baseUrl
Type: string
Your API’s public base URL. Required for Fastify when running behind a reverse proxy (Railway, Render, Fly, etc). Without it, x402 may construct http:// resource URLs when your API is actually https://.
onPayment
Type: (event: PaymentEvent) => void | Promise<void>
Callback fired after every successful payment settlement. Use it for usage tracking, webhooks, or business logic.
onPayment errors are caught and logged — they never interrupt the response or surface to the agent. See onPayment Callback for full details.
onError
Type: (error: MonkePayErrorContext) => void | Promise<void>
Callback fired on internal SDK errors. Use it to pipe errors to your alerting or logging system.
Per-route overrides
All adapters support per-route overrides. Set defaults at the instance level and override per route. Any config option can be overridden exceptapiKeyId and apiKeySecret.