I

Img402 · Upload

by Img402

POSTBaseSolana

$0.01

per call · USD Coin on Base

Upload an image with payment and get a public URL. Accepts multipart form-data (field 'image') or JSON {"file": "<base64>"}. 10MB max, permanent hosting (no expiration). PNG, JPEG, GIF, WebP.

Endpoint

POST https://img402.dev/api/upload

18

Calls / 30d

4

Unique payers / 30d

Sep 8

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://img402.dev/api/upload", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "file": "<base64-encoded-image>"
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://img402.dev/api/upload" \
  -H "Content-Type: application/json" \
  -d '{"file":"<base64-encoded-image>"}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "contentType": "image/png",
  "expiresAt": null,
  "id": "abc123",
  "sizeBytes": 12345,
  "url": "https://i.img402.dev/abc123.png"
}

Payment details

Pay to0x77f3c9bcb898ad1d30e9a336e2cc3108d88d6c09
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase, Solana
Schemesexact

Is this your API?

Pin it to the top of Media & Generation and the homepage with a featured placement.

Get featured →

More from Img402 & similar services