x402image is an MCP server of deterministic image-processing tools — remove background, AI upscale, resize, optimize. Your agent discovers them, pays a few cents per call over x402, and gets a finished image URL back. No account, no API key, no image library to install.
service_info first — it's free.
The customer here is another program. An AI agent maintaining a store's product photos has the recipe (which edits, what parameters) and the ingredients (an image URL) — but no kitchen (compute, image libraries). x402image is the kitchen: it takes the recipe, does the work, and hands back the plated result.
Real output from the same Cloudflare Images AI transforms the paid tools use — no mockups. Your agent sends a source image URL and gets a finished image URL back.
Input · photo as shot
Output · alpha cutout (checkerboard = transparent)
Input · 233×263, shown enlarged
Output · 932×1052
Source photos are CC0 / public domain (Wikimedia Commons).
resize and optimize are deterministic
geometry and codec operations — no before/after needed, they hit the
numbers you ask for.
Our own first end-to-end runs on Base mainnet — real USDC, really settled — plus the registry entry agents discover this server through. Every link below is independently verifiable.
Each tool is independently priced per call. Prices below are reference
values — the authoritative, live price and parameter schema always
come from service_info and the 402 quote.
| Tool | Price | What it does |
|---|---|---|
| remove_background | $0.02 | Isolate the subject and cut out the background (BiRefNet AI segmentation). Optional fill color, or a transparent cutout. |
| upscale | $0.02 | Enlarge with AI super-resolution (ESRGAN) for a sharper result at a target width and/or height. |
| resize | $0.005 | Resize or crop to an exact width/height, with fit and gravity controls (e.g. keep faces in frame). |
| optimize | $0.005 | Convert format (webp/avif/jpeg/png/gif) and/or compress to shrink file size at a chosen quality. |
| process | dynamic | Run an ordered pipeline of the ops above in a single paid call — one payment, one output. Price is the sum of the included ops. |
Call a paid tool without payment and you get an HTTP 402 with a machine-readable quote: price, currency, recipient, how to retry.
Settlement is USDC on the Base network through a Coinbase CDP facilitator. No sign-up, no stored card, no invoice.
The image is processed only after settlement confirms. If the work fails, you are not charged. Output is a short-lived signed URL that expires and is deleted automatically.
Send JSON-RPC over POST https://x402image.org/mcp.
Any MCP-compatible agent works — no keys to provision.
service_info
The free service_info tool returns the current tool
list, per-call prices, and how to pay. Read it before you spend.
Pass a source image URL (https only; private/internal addresses are refused). Pay the 402 quote, receive the processed image URL.
# 1 — initialize, and keep the session id the server hands back. # Every later request must echo it in the mcp-session-id header. SID=$(curl -sD - -o /dev/null https://x402image.org/mcp \ -H 'content-type: application/json' \ -H 'accept: application/json, text/event-stream' \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{ "protocolVersion":"2025-06-18","capabilities":{}, "clientInfo":{"name":"curl","version":"1.0"}}}' \ | tr -d '\r' | awk 'tolower($1)=="mcp-session-id:"{print $2}') # 2 — confirm the handshake. curl -s https://x402image.org/mcp \ -H 'content-type: application/json' \ -H 'accept: application/json, text/event-stream' \ -H "mcp-session-id: $SID" \ -d '{"jsonrpc":"2.0","method":"notifications/initialized"}' # 3 — discover: free, no payment. Returns tools, live prices, how to pay. curl -s https://x402image.org/mcp \ -H 'content-type: application/json' \ -H 'accept: application/json, text/event-stream' \ -H "mcp-session-id: $SID" \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/call", "params":{"name":"service_info","arguments":{}}}' # 4 — a paid tool without payment answers with the 402 quote: # amount, asset, payTo, network. Pay it and repeat the call. curl -s https://x402image.org/mcp \ -H 'content-type: application/json' \ -H 'accept: application/json, text/event-stream' \ -H "mcp-session-id: $SID" \ -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{ "name":"process","arguments":{ "source":"https://example.com/product.jpg", "steps":[{"op":"remove_background","params":{"background":"white"}}, {"op":"resize","params":{"width":800}}]}}}'
Paste all four as-is — they run end to end. Steps 1 and 2 are the MCP
handshake, which any MCP client does for you; skip them and the server
answers -32000 Mcp-Session-Id header is required. The
accept header must list both types — replies come back as
server-sent events.