heroes · gedx402

Image transform

Resize, fit, and transcode remote or base64 images — one x402 payment returns webp/jpeg/png/avif bytes. Artifacts bundle leg on images-api.gedx402.com.

$0.015 wire settlement

POST https://images-api.gedx402.com/v1/images/transform

@x402/fetch (TypeScript)

standard x402 client — fund USDC on Base, set PRIVATE_KEY. integrator quickstart

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const signer = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(signer));
const fetchWithPayment = wrapFetchWithPayment(fetch, client);

const res = await fetchWithPayment("https://images-api.gedx402.com/v1/images/transform", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    url: "https://example.com/photo.jpg",
    width: 800,
    format: "webp",
    fit: "cover"
  }),
});
const data = await res.json();

awal (agent convenience)

Coinbase Agentic Wallet CLI — no private key in code. external payer guide

npx awal@2.12.0 x402 pay \
  --url https://images-api.gedx402.com/v1/images/transform \
  --method POST \
  --body '{"url":"https://example.com/photo.jpg","width":800,"format":"webp","fit":"cover"}'

curl (discovery)

unauthenticated POST returns 402 + payment-required — inspect pricing before paying.

curl -X POST https://images-api.gedx402.com/v1/images/transform \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/photo.jpg","width":800,"format":"webp","fit":"cover"}'