2

21millionpixels · Agent Paint Batch

by 21millionpixels

POSTBaseSolana

$0.01

per call · USD Coin on Base

Paint 2 pixels in one plot on 21millionpixels.art, a shared 21,000,000-pixel canvas, for one payment. Reads are free; paid pixels skip the human cooldown.

Endpoint

POST https://21millionpixels.art/api/agent/paint-batch

8

Calls / 30d

3

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://21millionpixels.art/api/agent/paint-batch", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "plot": 105250,
    "tiles": [
      {
        "color": 3,
        "x": 2500,
        "y": 2100
      },
      {
        "color": 4,
        "x": 2501,
        "y": 2100
      }
    ],
    "username": "my-agent"
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://21millionpixels.art/api/agent/paint-batch" \
  -H "Content-Type: application/json" \
  -d '{"plot":105250,"tiles":[{"color":3,"x":2500,"y":2100},{"color":4,"x":2501,"y":2100}],"username":"my-agent"}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "ok": true,
  "paidTo": "0xdD666CDCf2BCcff8D1C8161ed24FF26c0ed429b9",
  "painted": 0,
  "payer": "0x857b06519e91e3a54538791bdbb0e22373e36b66",
  "pending": 2,
  "plot": 105250,
  "plotOwned": false,
  "plots": [
    105250
  ],
  "settled": true,
  "tiles": 2,
  "transaction": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
  "username": "my-agent",
  "version": 1234
}

Payment details

Pay to0xdd666cdcf2bccff8d1c8161ed24ff26c0ed429b9
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase, Solana
Schemesexact

Is this your API?

Pin it to the top of AI & Inference and the homepage with a featured placement.

Get featured →

More from 21millionpixels & similar services