Skip to content

Use the OpenAI SDK

If your code already calls OpenAI’s images.edit, it can call Remodeled AI with two changes: the API key and the base URL. The official OpenAI SDKs for Python, TypeScript, Go, Java and .NET all work, as does anything else that speaks OpenAI’s image API (LangChain, LiteLLM, Vercel AI SDK’s OpenAI provider).

base URL https://api.remodeled.ai/public/openai/v1
API key your rmk_ key
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["REMODELED_API_KEY"], 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)

model picks the tool. client.models.list() lists them.

model What it does prompt
remodel (default) Redesign the room, keeping walls, windows and camera angle Style and direction
staging Furnish an empty room Style and direction
declutter Empty the room Optional
exterior Restyle a house front or garden Style and direction
edit Make the one change the prompt describes The change
gpt-image-*, dall-e-* Treated as edit, so existing code keeps working The change

With model: "edit" (or a gpt-image-* name), add a mask (a PNG with transparent pixels over the area to change, as OpenAI uses) and the request becomes a brush edit that leaves the rest of the photo alone.

Field Here
image The room photo. More images (up to 4 extra, as image[]) are reference or item photos.
quality low, medium, high = Quick, Standard, Best (prices). auto or no quality = Standard. Room tools only.
size Picks the nearest aspect (1024x1024 square, 1536x1024 landscape, 1024x1536 portrait). Default: the photo’s own shape.
n 1 to 4 images (remodel, staging, declutter, exterior). Each is charged.
response_format url (default) or b64_json.
user Stored as metadata.user on the design.
Extra form fields room, style, change and scope work as on the native API.

The answer is OpenAI’s ImagesResponse with one addition, remodeled: the design’s id, the credits it cost and the tool used. The design is also visible with GET /public/v1/designs/{id}, and fires your webhook like any other.

  • It waits up to 90 seconds. Nearly every design finishes well within that. If one doesn’t, the answer is 504 still_rendering with details.designId; retry the same request and it waits on the same design instead of starting another.
  • Retries never pay twice. The OpenAI SDKs retry timeouts and 5xx on their own, without an idempotency key. The SDKs mark their retries with an x-stainless-retry-count header of 1 or more; such a retry of the same request within 10 minutes waits on the design the first attempt started. A request without that header (your own retry loop, or a client that doesn’t send it) starts a new design, so retry by hand only after checking GET /public/v1/designs.
  • images.generate is not supported (400 image_required): every tool starts from a photo of a room.
  • Errors come as {"error": {"code", "message"}} with our error codes. The OpenAI SDKs read them as usual: openai.APIStatusError with .status_code, and .code set to our code.
  • stream is not supported, and n must be 1 for edit.