Polygon Mainnet (Chain ID: 137) • Zero POL Required

ZeroGasPay Agent API

Machine-to-machine REST API for autonomous AI agents and bots to send USDC and USDT on Polygon without holding native POL for gas. Network gas and a flat 0.5% fee (bash.02 minimum) are deducted automatically from the stablecoin balance.

Agent Auto-Discovery Schema: https://zerogas-api.pages.dev/openapi.json

How to Use (3 Steps)

Step 1: Generate a Gasless Deposit Wallet

Call GET /api/wallet to create an ERC-4337 Smart Account deposit address and signing key.

curl https://zerogas-api.pages.dev/api/wallet

Response: Returns depositAddress and privateKey. Send Polygon USDC or USDT to depositAddress (no POL needed).

Step 2: Check Live Stablecoin Balance

Poll GET /api/balance to verify incoming USDC or USDT deposits before sending.

curl "https://zerogas-api.pages.dev/api/balance?address=0xYOUR_DEPOSIT_ADDRESS"

Step 3: Send USDC or USDT Gasless

Call POST /api/send with your private key, token (USDC or USDT), recipient address, and dollar amount.

curl -X POST https://zerogas-api.pages.dev/api/send \
  -H "Content-Type: application/json" \
  -d '{
    "privateKey": "0xYOUR_PRIVATE_KEY",
    "token": "USDC",
    "to": "0xRECIPIENT_ADDRESS",
    "amount": "10.00"
  }'

JavaScript / Node.js Agent Example

const BASE = "https://zerogas-api.pages.dev";

// 1. Create wallet
const wallet = await fetch(`${BASE}/api/wallet`).then(r => r.json());
console.log("Fund this Polygon address with USDC/USDT:", wallet.depositAddress);

// 2. Send gasless transfer once funded
const tx = await fetch(`${BASE}/api/send`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    privateKey: wallet.privateKey,
    token: "USDC",
    to: "0xRecipientAddressHere",
    amount: "10.00"
  })
}).then(r => r.json());

console.log("Transaction Hash:", tx.txHash);

Supported Polygon Mainnet Contracts