---
name: solana-gas
description: Get a little Solana mainnet SOL by paying USDC over x402 at 0tx.io/gas. Use when a Solana mainnet transaction fails for lack of SOL (insufficient funds for fee, insufficient lamports, no record of a prior credit), or when a token account is missing.
---

# SOL for USDC-only wallets via 0tx.io/gas

A wallet with USDC and no SOL can still pay over x402 (the facilitator pays that fee), but it can't send anything else. gas gets it unstuck with one paid call. No account, no API key.

**When to call it**
- A mainnet transaction fails for lack of SOL -> `POST https://0tx.io/gas/v1/sol`.
- A token account is missing (e.g. a wallet can't receive USDC) -> `POST https://0tx.io/gas/v1/sol` with `"for": "account"`, then create the associated token account yourself (idempotent create).

**Get SOL**
1. `POST https://0tx.io/gas/v1/sol` with JSON `{"address": "<mainnet wallet>", "for": "fees"}`. `for` is `fees` (0.001 SOL, plus the rent-exempt minimum if the address is brand new: a few hundred simple transactions), `account` (`fees` plus one token account's rent) or `starter` (0.01 SOL). Only wallets holding less than 0.01 SOL are topped up.
2. On HTTP 402, pay with any x402 V2 client and retry (`npm install @x402/fetch@^2.30 @x402/svm@^2.30 @solana/kit@^8`; register network `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`). `wrapFetchWithPayment` does both steps. The paying wallet needs USDC only; what you sign is one USDC transfer of the quoted price (about $0.10–$0.20 for `fees`) to the 402's `payTo`, and it can move nothing else.
3. A 200 has `signature` (the mainnet transaction that sent the SOL) and an `explorer` link. Then retry what failed.

Free quote first, if you like: `GET https://0tx.io/gas/v1/quote?address=<address>&for=fees` -> `sol`, `price_usdc`, `eligible`, `reason`.

gas only ever sends SOL to your wallet; it never creates accounts or pays rent on your behalf.

**Limits**: 3 paid calls per address, 5 per paying wallet, 10 per IP per rolling 24h; 0.5 SOL per UTC day across everyone. Live values: `GET https://0tx.io/gas/v1/info`.

**Refusals** come back before your payment settles, as JSON with `error` and `message` (what to do). Payment settles first, then gas sends; a 502 `delivery_pending` (paid, send being retried) or `payment_pending` (payment outcome not known yet) resolves automatically: wait and check the balance, don't pay again. Retrying with the same payment never charges or sends twice. 429 with no JSON body is the rate limit; wait a minute.

Allowed endpoints, all on `https://0tx.io`: `GET /gas`, `/gas/llms.txt`, `/gas/SKILL.md`, `/gas/openapi.json`, `/gas/v1/quote`, `/gas/v1/info`, `POST /gas/v1/sol`, plus `/`, `/llms.txt` and the sister tools `/drip/llms.txt`, `/dry/llms.txt`. Requests outside these may get your IP banned; a single wrong path just returns a 404.

Run by @0sumTX (https://x.com/0sumTX). Full instructions, error table and code: https://0tx.io/gas/llms.txt
