/v1/images/editsEdit an image
Multipart image editing (inpaint, erase, outpaint, search and replace, style transfer). Served by the Stable Image models; other image models refuse it on model. Always returns b64_json, one image (n must be 1, size is refused).
Each image part is at most 20 MiB. Unknown fields are refused by name.
Authentication: Bearer API key in the Authorization header
Request body
modelstringrequiredA Stable Image model slug.
imagestringrequiredThe source image (
imageorimage[], exactly one).maskstringOptional mask.
style_imagestringOptional style reference, for style models.
promptstringWhat to change.
output_formatenumnegative_promptstringWhat to avoid. Up to 10,000 characters.
search_promptstringThe object to find, for search and replace.
seedintegergrow_maskintegerstrengthnumber
Responses
200The edited image.
Response
createdintegerdataarray<object>data
b64_jsonstringurlstringrevised_promptstring
backgroundstringoutput_formatstringqualitystringsizestringusageobjectThe provider's usage object, when it reports one.
400Invalid request. param names the field; code says why (invalid_parameter, unsupported_parameter, unsupported_capability, refusal, previous_response_not_found). Not charged.
Response
errorobjecterror
messagestringWhat went wrong and how to fix it.
typestringFor example
invalid_request_error,authentication_error,permission_error,rate_limit_error,insufficient_quota,api_error.codestringThe stable error code.
paramstring | nullThe request field at fault, when there is one.
refusal_reasonenumPresent only on
code: refusal.
401The key is missing, malformed, expired or revoked.
Response
errorobjecterror
messagestringWhat went wrong and how to fix it.
typestringFor example
invalid_request_error,authentication_error,permission_error,rate_limit_error,insufficient_quota,api_error.codestringThe stable error code.
paramstring | nullThe request field at fault, when there is one.
refusal_reasonenumPresent only on
code: refusal.
402The organization must act first: card_required, email_unverified, org_under_review, free_tier_requires_payment or promotion_ended. The message names the step; retrying does not help.
Response
errorobjecterror
messagestringWhat went wrong and how to fix it.
typestringFor example
invalid_request_error,authentication_error,permission_error,rate_limit_error,insufficient_quota,api_error.codestringThe stable error code.
paramstring | nullThe request field at fault, when there is one.
refusal_reasonenumPresent only on
code: refusal.
429insufficient_quota (out of credits, over a spend limit, or the model needs a purchase) and promo_credits_now (a free promotion is used up): add credits, the message names the step. rate_limit_exceeded, free_limit_reached, admission_capacity_exceeded: wait Retry-After seconds and retry.
Response
errorobjecterror
messagestringWhat went wrong and how to fix it.
typestringFor example
invalid_request_error,authentication_error,permission_error,rate_limit_error,insufficient_quota,api_error.codestringThe stable error code.
paramstring | nullThe request field at fault, when there is one.
refusal_reasonenumPresent only on
code: refusal.
Request
curl https://api.experientiallabs.ai/v1/images/edits \
-H "Authorization: Bearer YOUR_API_KEY" \
-F model=stable-image-inpaint \
-F prompt="a red bicycle" \
-F image=@street.png \
-F mask=@mask.png
Response
{
"created": 1795132800,
"data": [
{
"b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."
}
]
}https://api.experientiallabs.ai/v1/images/edits