Fetch L402-protected URL
l402_fetchFetch a URL protected by L402 protocol, automatically paying the Lightning invoice from your session budget if required. Retries once after payment.
Instructions
Fetch a URL that may require a Bitcoin Lightning payment (L402 protocol). Side effect: deducts sats from the session budget when a payment is required — check l402_balance first if budget is limited. Flow: sends request → if 402 received, pays the Lightning invoice (1 attempt) → retries once with payment proof → returns response body as text. Fails with error if: budget is exhausted, URL is unreachable, or the Lightning payment fails. Do NOT use for regular (non-L402) URLs — use a standard fetch tool instead. Do NOT use if l402_balance shows 0 sats remaining.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The URL to fetch (http or https) | |
| method | No | HTTP method — GET, POST, PUT, DELETE, PATCH. Default: GET | |
| body | No | Request body as string (for POST/PUT requests) | |
| headers | No | Additional HTTP request headers as key-value pairs |