Skip to content
Fourohtwo

Edit an image with a prompt over x402

agent402.tools/v1/images/edits

Edit an image with a prompt over x402 - OpenAI images.edit wire (reference images and a prompt in, inline base64 out) at $0.02 per picture. Send one to 4 PNG or JPEG reference images (256 px a side or more, up to 6 MB each) as base64 or data: URLs in JSON, or one as a multipart "image" file; the output is one JPEG of about one megapixel that follows the first reference's aspect ratio. Served by FL

BaseUnchecked
POSThttps://agent402.tools/v1/images/edits

UptimeNot checked yet

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://agent402.tools/v1/images/edits", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"image":"<1118 characters; the full example is in /openapi.json>","prompt":"Turn the red square into a ripe red apple with a soft shadow"}),
});
console.log(await res.json());

Example input

{
  "image": "<1118 characters; the full example is in /openapi.json>",
  "prompt": "Turn the red square into a ripe red apple with a soft shadow"
}