x402_fetch sends an HTTP GET request to any URL. If the server responds with an HTTP 402 Payment Required status, Nebula automatically pays the required amount in Stellar USDC and retries the request — all in a single tool call. You do not need to inspect the 402 challenge manually; the Hub payment stack handles negotiation and settlement transparently.
Parameters
The fully-qualified URL to fetch. Must be a valid HTTP or HTTPS URL.
Maximum USDC you are willing to pay for this single request. If the 402 challenge demands more than this cap, the call is rejected before any payment is made. When omitted, the Hub applies your policy per-transaction cap automatically. Set this explicitly when fetching unfamiliar APIs to prevent surprise charges.
Responses
Success
Returned when the URL is fetched successfully (either no payment was needed, or a payment was made and the retry succeeded).Success response
Always
"ok" on success.The response body returned by the server after successful payment and retry.
The USDC amount actually charged. Will be
0 if no 402 was encountered.The Stellar address that received the payment. Present only when a payment was made.
The Stellar transaction hash for the payment. Present only when a payment was made.
Confirmation required
Returned when the payment would exceed the micro-payment threshold or is destined for a first-time payee that your policy flags for review. The call is paused until you explicitly confirm viaawait_confirmation.
Confirmation required response
Error
Returned when the request cannot be completed due to insufficient funds, a policy rejection, an invalid URL, or a network failure.Error response
reason values:
| Reason | Meaning |
|---|---|
Policy rejected: amount … exceeds per-tx cap | The 402 challenge price is above your configured per-transaction limit. Raise the cap or set max_amount_usdc lower to fail fast. |
Insufficient USDC balance | Your wallet does not hold enough USDC to cover the requested amount. |
max_amount_usdc exceeded | The 402 challenge price exceeds the max_amount_usdc you provided. |
Network error | The remote server could not be reached. |
Policy interaction
Every payment made byx402_fetch counts against both your per-transaction USDC cap and your daily USDC spend cap. If max_amount_usdc is omitted, the Hub uses min(per_tx_cap, policy_x402_cat_cap) as the ceiling. Requests that would push you over your daily limit are rejected before any on-chain transaction is submitted.
Example
Tool call
Response