$0.035
per call · USD Coin on Base
Image generation · seven-day hosted URL · 0% service fee launch promotion
Endpoint
POST https://onchainrouter.dev/v1/images/generations4
Calls / 30d
1
Unique payers / 30d
Sep 6
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://onchainrouter.dev/v1/images/generations", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"aspect_ratio": "1:1",
"image_size": "1K",
"model": "gemini-3.1-flash-lite-image",
"n": 1,
"prompt": "A small observatory beneath a clear night sky, editorial illustration",
"response_format": "url"
}),
});
const data = await res.json();cURL
curl -X POST \
"https://onchainrouter.dev/v1/images/generations" \
-H "Content-Type: application/json" \
-d '{"aspect_ratio":"1:1","image_size":"1K","model":"gemini-3.1-flash-lite-image","n":1,"prompt":"A small observatory beneath a clear night sky, editorial illustration","response_format":"url"}' \
-H "X-PAYMENT: <signed x402 payment>"Example response
{
"aspect_ratio": "1:1",
"created": 0,
"data": [
{
"backed_up": true,
"url": "https://onchainrouter.dev/v1/media/images/00000000-0000-4000-8000-000000000000?access=capability"
}
],
"image_size": "1K",
"model": "gemini-3.1-flash-lite-image",
"price": {
"amount": "0.035",
"currency": "USD"
}
}Payment details
Pay to
0xa7660dea6aadcc87cbb5e79ccd262d391e61de5dAsset
USD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913NetworksBase
Schemesexact
Is this your API?
Pin it to the top of Media & Generation and the homepage with a featured placement.
More from Onchain Router & similar services
Onchain Router · Messages
onchainrouter.dev
Anthropic-compatible request-priced llm inference · 0% service fee launch promotion
POSTBaseAI & Inference
$0.002 / call6 calls / 30d
Onchain Router · Chat Completions
onchainrouter.dev
Request-priced LLM inference · 0% service fee launch promotion
POSTBaseAI & Inference
$0.002 / call5 calls / 30d
Onchain Router · Audio Speech
onchainrouter.dev
Text-to-speech generation · 24-hour encrypted capability URL · 0% service fee launch promotion
POSTBaseMedia & Generation
$0.002 / call4 calls / 30d