Integrate
REALTIME AGENTIC ETHEREUM — x402 PAYMENT SUPPORT

Agentic Preconfirmations.

Gasless. Pay per request. No lockup of funds.

ETHGas speaks native HTTP 402. Agents buy a preconfirmation with a single signed request — gasless payment and the preconfirmed transaction lands in the next available block. No session, no top-ups, no held balances.

Try the flowEndpoint reference
1 sig
per request
0 gas
paid by the user
~54 ms
to confirmation
402 PAYMENT REQUIRED
HTTP/1.1 402 Payment Required
network: ethereum
asset: WETH
amount: 0.0021
asset-transfer-method: permit2
.01  THE CHALLENGE FLOW

Watch one request become a paid preconfirmation.

Run the exchange step by step. The user asks for blockspace, ETHGas answers with a 402 challenge, the wallet signs it, and the facilitator moves funds so you don’t have to pay any gas — all before the block is built.

agent → x402.ethgas.com/v1/preconfirmationsREADY
.02  HOW PAYMENT WORKS

One approval. Every request after is a single signature.

The user approves WETH once to the standard permit2 contract. Then an agent can initiate payment and get preconfirmation on their behalf.

PRECONDITION
The wallet must be funded with WETH before the first request. Preconfirmation is a paid service — the fee is charged from the pre-approved WETH balance.
STEP 01 · ONCE
Approve the permit2 contract

The user grants a one-time token approval to the standard permit2 contract. No further on-chain action is needed from them.

STEP 02
Third party calls the API

An app or agent hits the x402 endpoint to initiate a preauthorized transaction on the user's behalf.

STEP 03
Server returns a payload

ETHGas responds with a typed payload — the challenge — that the user must sign to authorize the spend.

STEP 04
Sign → Gasless Payment

After signing, the facilitator moves funds on behalf of the user. No gas is paid by the user.

STEP 05
Placed into the block

The transaction is sequenced into the next available block.

.03  ENDPOINT REFERENCE

Standard 402. No SDK required.

Any HTTP client can drive the flow. Request the resource, read the challenge from the 402 response, sign it, and retry with the payment response header. ETHGas verifies and returns the preconf receipt.

PAYMENT-REQUIRED

Signature scheme the caller must use — permit2 transfer back by eip712 signature.

PAYMENT-SIGNATURE

The caller returns the signature back to ETHGas server.

PAYMENT-RESPONSE

ETHGas returns a successful preconfirmation.

Give your agents a way to pay.

Integrate x402 preconfirmations in an afternoon. Standard HTTP, one approval, gasless from there.