W

Workers · Generate

by Workers

POSTBase

$0.01

per call · USD Coin on Base

Generate 1-4 AI images from a text prompt using flux-schnell. $0.01 per image (price = $0.01 × num_outputs). Returns a job_id claim ticket; retrieve images free at /result/{job_id} (durable, no expiry).

Endpoint

POST https://pixel402.dylan-caponi.workers.dev/generate

3

Calls / 30d

2

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://pixel402.dylan-caponi.workers.dev/generate", {
  method: "POST",
});
const data = await res.json();
cURL
curl -X POST \
  "https://pixel402.dylan-caponi.workers.dev/generate?prompt=a+cat+wearing+a+top+hat+in+a+field+of+sunflowers" \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "image_url": "https://pixel402.dylan-caponi.workers.dev/result/6f1c9e2a-4b7d-4c1e-9a2f-3d5e8b7a0c1d",
  "job_id": "6f1c9e2a-4b7d-4c1e-9a2f-3d5e8b7a0c1d",
  "model": "black-forest-labs/flux-schnell",
  "note": "Image stored durably. GET image_url anytime (free). If status is 'processing' (HTTP 202), poll result_url every ~10s.",
  "parameters": {
    "aspect_ratio": "1:1",
    "output_format": "webp",
    "output_quality": 80
  },
  "prediction_id": "abc123xyz",
  "price_paid": "$0.01",
  "prompt": "a cat wearing a top hat in a field of sunflowers",
  "status": "succeeded"
}

Payment details

Pay to0x309fd902b4b29905c8493c94a569673e1d6dc0d3
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

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

Get featured →

More from Workers & similar services