x402
Call paid x402 endpoints with automatic Solana USDC payment.
The x402 node calls an x402-enabled HTTP endpoint. If the endpoint returns HTTP 402 with payment terms, Solaris AI Flow signs and sends the payment from your embedded Privy wallet, then retries the request.
Use it when an API charges per request through x402 instead of a normal API key.
Prerequisites
- A signed-in Solaris AI Flow account with an embedded Privy wallet
- SOL for gas
- USDC in the embedded wallet if the endpoint requires payment
- An x402 endpoint that supports Solana mainnet USDC
Solaris AI Flow only settles x402 payments in USDC on Solana mainnet. Endpoints advertising another network or asset are refused.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
| Node Label | string | No | Display name shown on the canvas |
| Response Name | string | Recommended | Variable name used by downstream nodes. Defaults to x402Response |
| HTTP Method | select | Yes | GET or POST |
| Endpoint URL | string | Yes | x402-enabled URL. Supports template expressions |
| Request Body | string | For POST | JSON body. Supports template expressions |
| Headers | JSON object | No | Custom request headers. Header values must be strings |
| Max USDC per call | number | No | Optional spend cap. Payments above this amount are rejected before signing |
Reserved x402 transport headers are managed by Solaris AI Flow and cannot be supplied manually.
Checking an endpoint
Click Check URL reachability before saving or running. The check:
- Sends an unauthenticated GET request
- Detects whether the endpoint returns HTTP 402
- Shows advertised payment terms when available
- Checks whether your wallet appears to have enough USDC and SOL gas
- Warns when the endpoint uses an unsupported network, malformed payment terms, or a price above your Max USDC cap
The check is GET-only. POST-only endpoints may show a status that differs from the actual configured POST call.
Output
Downstream nodes usually read:
{x402Response.response.body}
{x402Response.response.headersLowercase}A successful paid or unpaid request returns the HTTP response body, response headers, status information, and payment metadata when payment was attempted.
Safety notes
- Running the workflow may spend USDC
- Payment happens automatically during execution after the endpoint advertises valid terms
- Use Max USDC per call for dynamic or unfamiliar endpoints
- If a network error happens after signing, inspect your wallet before retrying to avoid paying twice
- For async jobs, pair x402 with HTTP, Delay, and Condition nodes to poll the returned job URL or status field
Common use cases
- Pay-per-call data APIs
- Paid AI or analytics endpoints
- Workflows that purchase a single API response only when upstream conditions are met
