Skip to content

Edit an image (OpenAI images.edit)

POST https://api.remodeled.ai/public/openai/v1/images/edits

OpenAI's images.edit, for the official OpenAI SDKs with base URL https://api.remodeled.ai/public/openai/v1. Starts a design and answers when it has finished (up to 90 seconds). A retry by the SDK of the same request waits on the same design instead of paying twice.

Authentication: API key (Authorization: Bearer rmk_...). Operation id openaiEditImage.

Example

from openai import OpenAI
client = OpenAI(api_key="rmk_...", base_url="https://api.remodeled.ai/public/openai/v1")
result = client.images.edit(
model="remodel",
image=open("living-room.jpg", "rb"),
prompt="Japandi living room, warm oak and linen",
quality="medium",
)
print(result.data[0].url)

Request body

multipart/form-data

Schema: OpenAIEditForm

FieldTypeDescription
imagerequiredfileThe photo. Send up to 5 (image[]): the first is the photo, the rest are references.
promptstringUp to 2000 characters.
modelstringremodel (default), staging, declutter, exterior or edit. OpenAI model names (gpt-image-*, dall-e-*) mean edit.
maskfilePNG; transparent pixels mark the area to change. Makes it a brush edit.
nintegerFrom 1 to 4.
quality"low", "medium", "high", "auto"Quick, Standard or Best.
sizestringauto, or WIDTHxHEIGHT: picks the nearest aspect.
response_format"url", "b64_json"
userstringStored as metadata.user.
roomstring
stylestring
change"restyle", "rearrange", "renovate"
scope"focused", "redesign"

Responses

200 The finished images

Returns OpenAIImagesResponse.

200 OpenAIImagesResponse
{
"created": 1763424607,
"data": [
{
"url": "https://cdn.remodeled.ai/output/01a1ebfd-492a-71c8/01a1ebfd-4963-73bc-8fe2-b84eb626ebfa.png"
}
],
"remodeled": {
"designId": "01a1ebfd-4958-74a0-8036-fd131dcc3bd2",
"creditsCharged": 5,
"mode": "remodel"
}
}

401 invalid_api_key: missing, wrong or revoked key

An error.

{
"error": {
"code": "invalid_api_key",
"message": "Missing or invalid API key. Send it as Authorization: Bearer rmk_..."
}
}

402 insufficient_credits or key_limit_reached

An error.

{
"error": {
"code": "key_limit_reached",
"message": "This key may spend 500 credits in 30 days and has used 498. Raise its limit in Account, API keys.",
"details": {
"limit": 500,
"used": 498,
"cost": 5
}
}
}

422 invalid_request or design_failed

An error.

{
"error": {
"code": "key_limit_reached",
"message": "This key may spend 500 credits in 30 days and has used 498. Raise its limit in Account, API keys.",
"details": {
"limit": 500,
"used": 498,
"cost": 5
}
}
}

429 rate_limited (wait Retry-After seconds) or too_many_active

An error.

{
"error": {
"code": "key_limit_reached",
"message": "This key may spend 500 credits in 30 days and has used 498. Raise its limit in Account, API keys.",
"details": {
"limit": 500,
"used": 498,
"cost": 5
}
}
}

504 still_rendering: retry, or fetch details.designId

An error.

{
"error": {
"code": "key_limit_reached",
"message": "This key may spend 500 credits in 30 days and has used 498. Raise its limit in Account, API keys.",
"details": {
"limit": 500,
"used": 498,
"cost": 5
}
}
}

Every answer carries RateLimit-Limit, RateLimit-Remaining and X-Request-Id. See rate limits and errors. API version 1.2.0.