Edit an image with a prompt over x402
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 FLUX 3 Image Klein in about 10 seconds. No mask: describe the change in the prompt.
Paid test badge: not yet. The checks above are free: we call the tool without paying and read the payment request it sends back. The Verified badge needs paid calls whose answers match the promised output, and nobody can buy a badge.
Endpoint
POST https://agent402.tools/v1/images/edits
| Category | Image and media |
|---|---|
| Provider host | agent402.tools |
| Networks | eip155:10, eip155:1329, eip155:137, eip155:143, eip155:42161, eip155:42220, eip155:43114, eip155:4663, eip155:8453 |
| Payment schemes | exact |
| Self-reported calls, 30 days | 3 from 2 payers (the provider's figure, not ours) |
Our checks, last 30 days
We never call tools that send, buy, move money or file anything, not even without paying.
Example input (from the provider)
{
"body": {
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAIAAAD2HxkiAAAC+0lEQVR42u3TwQkAMAgEQcux/3rsJfnl60eQwAxXwcHGAVaFC0CEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhYyrT3kSICEWICEUoQkQoQkQoQhEiQhEiQhGKEBGKEBGKUISIUISIUIQiRIQiRIQiFCEiFCEiFKEIEaEIEaEIRYgIRYgIRShCRChCRChCESJCESJCEYoQEYoQEYpQhIhQhIhQhCJEhCJEhCIUISIUISIUoQgRoQgRoQhFiAhFiAhFKEJEKEJEKEIRIkIRIkIRihARihARilCEiFCEiFCEIkSEIkSEIhQhIhQhIhQhiFCEiFCEIEIRIkIRgghFiAhFCCIUISIUIYhQhIhQhCBCESJCESJC7YkQEYoQEZoIEaEIEaGJEBGKEBGKUISIUISIUIQiRIQiRIQiFCEiFCEiFKEIEaEIEaEIRYgIRYgIRShCRChCRChCESJCESJCEYoQfiZCECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQaFwp5rW6Afb8QQAAAABJRU5ErkJggg==",
"prompt": "Turn the red square into a ripe red apple with a soft shadow"
},
"bodyType": "json",
"method": "POST",
"type": "http"
}
Promised output schema (from the provider)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"input": {
"additionalProperties": false,
"properties": {
"body": {
"properties": {
"image": {
"description": "One to 4 reference images, each base64 or a data: URL (PNG or JPEG, at least 256x256, up to 6 MB each). Image URLs are not fetched.",
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 4,
"minItems": 1,
"type": "array"
}
]
},
"prompt": {
"description": "What to change (up to 4,000 chars)",
"type": "string"
}
},
"required": [
"prompt",
"image"
]
},
"bodyType": {
"enum": [
"json",
"form-data",
"text"
],
"type": "string"
},
"method": {
"enum": [
"POST"
],
"type": "string"
},
"type": {
"const": "http",
"type": "string"
}
},
"required": [
"type",
"method",
"bodyType",
"body"
],
"type": "object"
},
"output": {
"properties": {
"example": {
"type": "object"
},
"type": {
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
},
"required": [
"input"
],
"type": "object"
}