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.
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)import fs from 'node:fs';import OpenAI from 'openai';
const client = new OpenAI({ apiKey: process.env.REMODELED_API_KEY, baseURL: 'https://api.remodeled.ai/public/openai/v1' });
const result = await client.images.edit({ model: 'remodel', image: fs.createReadStream('living-room.jpg'), prompt: 'Japandi living room, warm oak and linen', quality: 'medium',});console.log(result.data?.[0]?.url);curl -X POST https://api.remodeled.ai/public/openai/v1/images/edits \ -H "Authorization: Bearer $REMODELED_API_KEY" \ -F model=remodel \ -F "prompt=Japandi living room, warm oak and linen" \ -F quality=mediumRequest body
multipart/form-data
Schema: OpenAIEditForm
| Field | Type | Description |
|---|---|---|
imagerequired | file | The photo. Send up to 5 (image[]): the first is the photo, the rest are references. |
prompt | string | Up to 2000 characters. |
model | string | remodel (default), staging, declutter, exterior or edit. OpenAI model names (gpt-image-*, dall-e-*) mean edit. |
mask | file | PNG; transparent pixels mark the area to change. Makes it a brush edit. |
n | integer | From 1 to 4. |
quality | "low", "medium", "high", "auto" | Quick, Standard or Best. |
size | string | auto, or WIDTHxHEIGHT: picks the nearest aspect. |
response_format | "url", "b64_json" | |
user | string | Stored as metadata.user. |
room | string | |
style | string | |
change | "restyle", "rearrange", "renovate" | |
scope | "focused", "redesign" |
Responses
200 The finished images
Returns 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 } }}