How AI Agents and Scripts Buy EVM Gas via API
A complete guide to programmatically ordering micro gas for bots, autonomous agents, and CI pipelines without API keys, accounts, or KYC verifications.
Autonomous software agents and backend scripts frequently encounter the cold-start gas problem. When an agent generates a fresh externally owned account (EOA) to claim an airdrop, sweep tokens, or execute smart contract calls, the address has zero native balance to pay network validators.
To solve this, developers look for an API buy ETH gas solution. While centralized exchanges demand KYC verification and account credentials, 1gwei.dev provides an open HTTP gas station where an agent script fund wallet gas workflow operates with no API key gas top-up requirements.
Agents need native gas balances, not just payment protocols
Payment protocols such as x402 enable agents to settle HTTP API requests using machine-to-machine stablecoins. However, on-chain EVM transactions still consume native assets to execute bytecode. An agent holding off-chain credits cannot move an on-chain token until its wallet holds a native gas balance EOA.
Whether operating on Ethereum (ETH), Arbitrum (ETH), Base (ETH), Robinhood (ETH), Polygon (POL), HyperEVM (HYPE), BNB Chain (BNB), or the Sepolia (ETH) testnet, validators require genuine native tokens. Payouts must deliver real gas directly to the destination address.
Gas station API vs paymaster and sponsorship relayers
Paymasters sponsor account abstraction UserOperations
ERC-4337 paymasters allow gasless transactions or fee payment in ERC-20 tokens, but they only function when working with smart contract accounts configured to use an active paymaster relayer.
A gas station delivers native gas to arbitrary EOAs
Standard developer scripts and standard keys cannot rely on paymasters. A dedicated openapi gas station sells small native gas balances directly to any destination address following an invoice payment, requiring no special contract scaffolding.
The programmatic order loop: Quote, Order, Pay, Poll
The integration loop is documented in our plain-text machine endpoints at llms.txt gas and llms-full.txt. It consists of four lightweight HTTP steps.
1. Request a live price quote
Call GET /api/quote?chain={chain}ðAmount={amount} to fetch the live invoiceUsd amount and the current network base fee before initiating an order.
2. Create the gas order
POST /api/orders with a JSON payload specifying destAddress, chain, ethAmount, and method. Supported methods include LN, XMR, and x402. You can optionally include ref for partner attribution or sendAt for scheduled delivery.
3. Settle the payment invoice
The response provides an awaiting_payment order. For Lightning, your agent settles the bolt11 invoice via lightning invoice gas api methods. For Monero, the agent sends funds to payment.address via monero pay gas programmatically flows. For x402, settlement occurs via Base USDC transfer.
4. Poll until payout confirmation
Poll GET /api/orders/{id} every 3 to 8 seconds. Once payment confirms, status transitions to paid, then to sent. The agent can then poll order txhash from the response payload to verify on-chain finality.
Multi-chain token parameters and network amounts
While the parameter is named ethAmount in order requests, it represents the native token of the chosen network. When targeting Polygon the amount represents POL, on HyperEVM it represents HYPE, and on BNB Chain it represents BNB.
Check GET /api/meta for live minimums, maximums, and presets across all chains. Because this service is built for micro refueling rather than large financial swaps, orders are intentionally capped to modest operational sizes.
Automating CI pipelines and Sepolia testnet funding
Automated test suites and CI runners often fail when public testnet faucets run dry or require interactive GitHub authentication and captcha challenges.
Using our sepolia gas api ci flow, automated test harnesses can order testnet ETH on demand before deploying ephemeral contracts, eliminating pipeline flakiness without manual human intervention.
Error handling, safety, and privacy boundaries
On-chain transactions are final and irreversible: scripts should always validate recipient address checksums prior to submitting an order.
Regarding privacy and custody: payouts originate from our operator hot wallet and are not dispensed from a decentralized smart contract pool. 1gwei.dev does not make your wallet address untraceable, and nothing obscures the public on-chain payout on block explorers. What is guaranteed is that no personal identification, account registration, or exchange account link connects your agent's funding source to the destination address.
Questions people ask
How can an AI agent top up an EVM wallet with gas without KYC?
An agent can call 1gwei.dev's public REST API to create an order specifying the destination wallet and chain, settle the returned Lightning or Monero invoice programmatically, and poll until the native gas payout transaction broadcasts.
What is the difference between a paymaster API and a gas station API?
A paymaster API sponsors account-abstraction UserOperations for smart accounts. A gas station API delivers native gas tokens (ETH, POL, HYPE, BNB) directly to standard EOA addresses so they can execute any arbitrary transaction.
What is the recommended polling interval for order status?
We recommend polling GET /api/orders/{id} every 3 to 8 seconds. Polling faster than every 2 seconds may trigger rate limits, while polling slower than 10 seconds introduces unnecessary execution latency.
Which parameters are required when calling POST /api/orders?
Requests must supply destAddress (the receiving 0x address), chain (the chain key, such as base or hyperevm), ethAmount (the desired quantity of native gas), and method ('LN', 'XMR', or 'x402').
Can CI/CD pipelines use this API to fund Sepolia testnet wallets?
Yes. CI runners can programmatically create an order for Sepolia testnet ETH and settle the invoice, avoiding public faucet rate limits, captchas, and GitHub account requirements.
How does payment privacy work for automated scripts?
When paying via Monero or Lightning, no sender identity or exchange account is recorded on-chain. The payout from our hot wallet to your destination address is public on the explorer, but no link connects it to the agent's funding source.