API Documentation
MeltFlex REST API for AI interior design
Upload a room photo, describe the desired style or provide furniture references, and receive a photorealistic result. Each call costs 10 credits (auto-refunded on failure).
API access requires an Enterprise subscription (Growth plan or higher). After you are subscribed, you can generate your API key in account settings.






Take the result and restyle it with a single prompt:
"Design this room as Italian contemporary"
"Design this room as Japanese"
Tutorial
Before you start
You need an Enterprise subscription (Growth plan or higher) to use the API. Once subscribed, go to your account settings and click API Key under Profile:

Then click Generate API Key. The key is shown only once, copy it immediately.

- Auth: Send
Authorization: Bearer mf_sk_...in every request header. - Content-Type:
application/json - Credits: Each generation costs 10 credits, deducted before processing. Failed generations are refunded automatically.
- Timeout: Requests have a 2-minute timeout. Large images may take 30–90 seconds to process.
Basic usage: Restyle a room
The simplest call takes a room image and a text prompt. The API returns a base64-encoded PNG of the transformed room.
export MELTFLEX_API_KEY="mf_sk_..."
curl -X POST "https://www.meltflexai.com/api/v1/generate" \
-H "Authorization: Bearer $MELTFLEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "https://your-cdn.com/empty-room.jpg",
"prompt": "Transform this empty room during sunset with warm golden light"
}'The response contains a data:image/png;base64,... string. Decode it and save to a file, display in your UI, or upload to your CDN.
Furniture placement
To place specific furniture in a room, send reference images alongside the main room photo. The AI will match each item's appearance (colors, materials, textures) and position them naturally.
referenceImageUrlsarray of public URLs pointing to furniture/decor photos (up to 10)referenceProductsoptional metadata for each image: name for accurate placement
import requests
API_KEY = "mf_sk_..."
URL = "https://www.meltflexai.com/api/v1/generate"
response = requests.post(URL, json={
"imageUrl": "https://your-cdn.com/empty-room.jpg",
"prompt": "Place these furniture items naturally in this room during sunset",
"referenceImageUrls": [
"https://your-cdn.com/modular-sofa.jpg",
"https://your-cdn.com/upholstered-bed.jpg",
"https://your-cdn.com/dining-table.jpg",
"https://your-cdn.com/oak-chair.jpg"
]
}, headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
})
data = response.json()
if data.get("success"):
print(f"Room furnished with 4 items during sunset")For best results, use clean product photos on white/neutral backgrounds.
Production tips
- Use image URLs over base64 when possible. It avoids hitting the 15 MB body limit and is faster.
- Retry on 429: Implement exponential backoff (e.g. 1s, 2s, 4s, up to 30s).
- Timeouts: Set a client-side timeout of ~2 minutes. If the request times out, credits are refunded server-side.
- Image quality: Input images of at least 1024px on the longest side produce the best results.
- Prompt specificity: Be specific. "Scandinavian style with warm oak flooring and linen curtains" works better than "make it nice".
- Security: Never expose your API key in client-side code. Make API calls from your backend.
API Reference
Generate Image
Transform a room photo into a photorealistic interior design image. Optionally attach reference images of furniture to place in the room.
https://www.meltflexai.com/api/v1/generateRequest Headers
| Field | Value | Description |
|---|---|---|
Authorization | Bearer mf_sk_... | Your API key from account settings. |
Content-Type | application/json | Request body format. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Describes the desired transformation. E.g. "Transform into scandinavian style", "Make it minimalist with warm lighting", "Place the furniture naturally". |
image | string | Conditional* | Base64 data URL of the room image. Format: data:image/jpeg;base64,... |
imageUrl | string | Conditional* | Publicly accessible URL of the room image. The server fetches it directly. Preferred over base64. |
referenceImages | string[] | No | Array of base64 data URLs for reference images (furniture, decor). Up to 10. |
referenceImageUrls | string[] | No | Array of public URLs for reference images. Up to 10. Preferred over base64 for better performance. |
referenceProducts | object[] | No | Metadata for each reference image. Each object: {"name": "Sofa"}. Helps the AI identify and place items correctly. |
* Either image or imageUrl must be provided. If both are sent, imageUrl takes priority.
Response Body
A successful request returns HTTP 200 with a JSON body:
{
"success": true,
"image": "data:image/png;base64,iVBORw0KGgo...",
"creditsUsed": 10
}| Field | Type | Description |
|---|---|---|
success | boolean | true if the image was generated successfully. |
image | string | Base64-encoded PNG data URL of the generated image. |
creditsUsed | number | Number of credits charged for this request. |
Resources
Limits
| Limit | Value |
|---|---|
| Credit cost per generation | 10 credits |
| Max request body size | 15 MB |
| Request timeout | 2 minutes |
| Max reference images per request | 10 |
| Max active API keys per account | 5 |
| Output format | PNG (base64 data URL) |
If you receive HTTP 429, implement exponential backoff before retrying. Need higher limits? Check our subscription plans.
Error codes
Error responses include a JSON body with an error field:
{
"error": "Insufficient credits",
"message": "You need 10 credits. Check your balance at meltflexai.com/settings",
"required": 10
}| Status | Meaning | Details |
|---|---|---|
| 200 | Success | Image generated successfully. |
| 400 | Bad Request | Missing or invalid fields (prompt, image). |
| 401 | Unauthorized | Invalid, missing, or revoked API key. |
| 402 | Payment Required | Insufficient credits. Top up your account. |
| 405 | Method Not Allowed | Only POST is supported. |
| 429 | Rate Limited | Too many requests. Wait and retry with exponential backoff. |
| 500 | Server Error | Generation failed. Credits are refunded automatically. |