Tools / AI
Generate an image
Generates a 1024x1024 image from a text prompt with the FLUX.1 [schnell] model. Returns a JPEG directly, or base64 JSON with format=json.
- Price per call
- $0.02 USDC
- Endpoint
- POST https://x402-tools.com/v1/image
- Also accepts
- GET with query parameters
- Payment
- x402, exact scheme, USDC on Base
- Returns
- image/jpeg
Parameters
| Name | Type | Description |
|---|---|---|
| prompt required | string | What to draw (max 2000 characters). |
| steps | number | Diffusion steps, 1 to 8 (default 4). More steps, more detail. |
| format | string | 'jpeg' (default, raw image) or 'json' (base64). |
Call it from an agent
import { wrapFetchWithPayment } from "x402-fetch";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY);
const paidFetch = wrapFetchWithPayment(fetch, account);
const res = await paidFetch("https://x402-tools.com/v1/image", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"prompt": "A friendly robot paying at a vending machine with a coin, flat illustration",
"steps": 4,
"format": "json"
}),
});
// costs $0.02 in USDC on Base
Without a payment the endpoint answers 402 with the price, so you can inspect it first:
curl -i -X POST "https://x402-tools.com/v1/image" -H "content-type: application/json" -d '{"prompt":"A friendly robot paying at a vending machine with a coin, flat illustration","steps":4,"format":"json"}'
Example response
{
"note": "Raw JPEG bytes, or with format=json:",
"prompt": "A friendly robot…",
"mime_type": "image/jpeg",
"image_base64": "/9j/4AAQSkZJRg…"
}
If the tool fails or your input is invalid, the payment is not settled.
Other tools
Web page to markdown$0.003
Turn any URL (HTML, PDF, Office docs) into clean markdown an agent can read.
Website screenshot$0.01
A PNG screenshot of any web page, rendered in a real browser.
Summarize text or a URL$0.005
A faithful short, medium or long summary of any text or web page.
Extract structured data$0.01
Pull JSON fields out of any text or web page, matching your schema.
Translate text$0.003
Translate text into any language, keeping formatting and tone.
Base wallet lookup$0.002
ETH, USDC and any ERC-20 balances for an address on Base, live from the chain.