generate_mpp_challenge
Generate IETF MPP 402 payment challenges to gate API resources, specifying amount, networks, and expiration for crypto payment requirements.
Instructions
Generate an IETF MPP (draft-ryan-httpauth-payment) 402 challenge that an API server can return to gate a resource. Produces the WWW-Authenticate and X-Payment-Required headers plus the challenge_id to echo.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resource_id | Yes | Logical resource identifier (e.g. "premium-kb"). | |
| amount_microunits | Yes | Amount in asset micro-units (1 USDC = 1_000_000). | |
| networks | No | Networks to accept. Defaults to ["algorand_mainnet"] if omitted. | |
| expires_in_seconds | No | Challenge TTL; default 300. |