Edit images with tools
Pass a public image_url to any of four editing tools to modify an existing image. Each call bills a fixed number of credits and resolves synchronously.
| Tool | Path | Cost | Body |
|---|---|---|---|
| Remove background | /remove_background | 5 cr | image_url |
| Upscale | /upscale | 2 cr (2×) / 4 cr (4×) | image_url, desired_increase 2|4 |
| Expand / extend | /expand | 5 cr | image_url, optional aspect_ratio, prompt |
| Erase object | /erase | 2 cr | image_url, object_name |
All tools accept preserve_alpha (boolean, default true) to keep transparency where supported.
Erase an object
curl https://multigen.fdmultimedia.workers.dev/v1/images/tools/erase \
-X POST -H "X-API-Key: $MULTIGEN_API_KEY" -H "Content-Type: application/json" \
-d '{
"image_url": "https://your-cdn.app/image.png",
"object_name": "the plastic wrapper"
}'
Response:
{
"id": "job_7a1c02ef",
"status": "succeeded",
"tool": "erase",
"credits_used": 2,
"data": { "url": "https://…/output.png" }
}
Expand an image
curl https://multigen.fdmultimedia.workers.dev/v1/images/tools/expand \
-X POST -H "X-API-Key: $MULTIGEN_API_KEY" -H "Content-Type: application/json" \
-d '{
"image_url": "https://your-cdn.app/image.png",
"aspect_ratio": "16:9",
"prompt": "extend the counter on both sides, keep the same lighting"
}'
Accurate & up to date
Costs reflect the same scene billing used in the Layer Lab editor and the Studio tools, so the API and the dashboard always agree.