AI agents are starting to use tools autonomously — calling APIs, fetching data, executing tasks. But every time an agent pays for an API on a blockchain, it needs gas tokens to cover the transaction fee. That's an extra token to manage, an extra balance to monitor, and an extra thing that can go wrong.
We just removed that problem on Avalanche.
With 0xGasless now integrated into RelAI, your AI agent can pay for any Avalanche API using USDC — and never touch AVAX for gas. The 0xGasless relayer picks up the transaction cost.
Why This Matters for Agents
If you're building autonomous agents that consume paid APIs, you've probably hit this:
- Gas management is overhead. Your agent needs AVAX just to move USDC. That means bridging, monitoring balances, handling refills — all for a few cents of gas.
- MCP tools should just work. When an agent calls a tool through the Model Context Protocol, it shouldn't need to worry about which gas token a chain uses.
- Wallets should be simple. Fund the agent wallet with USDC, and that's it.
How It Works with MCP
RelAI exposes every x402-protected API as an MCP tool. When an AI agent calls one of these tools:
- The MCP server returns HTTP 402 — "this tool costs $0.01"
- The agent's x402 client signs a payment authorization (off-chain, free)
- The MCP server forwards the signed payment to the 0xGasless relayer
- 0xGasless verifies the signature, executes the USDC transfer on-chain (paying gas), and returns the result
- The agent gets the tool output
One-Time Wallet Setup
There's one prerequisite: the agent wallet must approve the 0xGasless relayer contract to spend its USDC. This is a standard token approval that happens once:
USDC.approve(relayerContract, unlimited)
This costs a tiny amount of AVAX (~$0.01) and only needs to happen once per wallet. After that, every payment is just a signature — no gas, no on-chain transactions from the agent.
> Tip: Do this during agent wallet provisioning, right after funding with USDC. Then your agent is ready to pay for any 0xGasless-enabled API indefinitely.
Using the RelAI SDK
The SDK handles everything automatically — facilitator detection, domain switching, payment signing:
import { createX402Client } from '@relai-fi/x402'
const client = createX402Client({
evmWallet: { address: agentWallet.address, signTypedData: agentWallet.signTypedData }
})
// Agent pays for API access — 0xGasless handles gas
const data = await client.fetch('https://weather-api.example.com/forecast?city=NYC')
No special configuration for 0xGasless. The SDK detects it from the server's payment requirements and adjusts the signing domain automatically.
Two Gasless Options on Avalanche
RelAI now offers two facilitators on Avalanche. Both eliminate gas fees for the end user (or agent):
| 0xGasless | RelAI Facilitator | |
|---|---|---|
| Who pays gas | 0xGasless relayer (third-party) | RelAI backend |
| Wallet setup | One-time USDC approval (~$0.01) | Nothing needed |
| After setup | Signature only (free) | Signature only (free) |
| Best for | Agents that want third-party settlement | Simplest possible setup |
For API Providers
If you're selling API access on Avalanche, this means more potential buyers. Agents no longer need to hold AVAX — just USDC. To enable 0xGasless on your API:
- Go to the RelAI dashboard
- Select 0xGasless as facilitator, Avalanche as network
- Set your pricing
- Done — agents and users get gasless payments automatically
What's Next
This is part of our push to make every x402 API accessible to autonomous agents with minimal wallet complexity. We're expanding 0xGasless support to additional EVM networks and working on further reducing the setup friction for agent wallets.
Start building at relai.fi.
Need the full payment flow first? Read the x402 overview and the RelAI documentation.
RelAI connects AI agents to paid APIs through the x402 protocol and MCP. With 0xGasless on Avalanche, agents pay only for what they use — and never worry about gas.
