API reference · Images
Edit an image
POSThttps://api.useunbound.ai/v1/images/edits
Send one image and editing instructions. The price for the selected output resolution is held before the job runs. The response contains the finished image.
Headers
AuthorizationrequiredBearer <key>, with a key from Settings → API.Idempotency-KeyA unique key up to 200 characters. Retrying with the same key returns the same images and is charged once.
Body
multipart/form-data
modelrequiredAn image-editing model from GET /v1/models.
promptrequiredHow to change the image.
imagerequiredOne PNG, JPEG or WebP file, up to 1 MiB.
nNumber of images, up to the model limit.
sizeOpenAI-style size such as
1024x1024. Mapped to the nearest aspect ratio and resolution.aspect_ratioUnbound field, for example
16:9. Takes precedence oversize.resolutionUnbound field, for example
2k. Takes precedence oversize.qualityOnly for models that declare quality levels.
seedOnly for models that support a seed.
negative_promptOnly for models that support it.
response_formatBase64 in the response, or signed links that expire after one hour.
Response
The edited images.
createdrequireddatarequiredb64_jsonBase64 image data, when
response_formatisb64_json.mime_typeSent with
b64_json.urlA signed link, when
response_formatisurl.
Errors
- 400The request is malformed, or a parameter is not supported by the model.
- 401The API key is missing, revoked or expired.
- 402Not enough credit, or the key reached its spending limit. Nothing was charged.
- 403The key does not have the scope this endpoint needs.
- 404The model does not exist or is not available through the API.
- 409The edit was cancelled.
- 413The image or request is too large.
- 429Too many requests for this key. Retry after the number of seconds in the Retry-After header.
- 502The upstream provider failed. The hold was released; you were not charged.
All errors use the envelope described in the introduction. None of them result in a charge.