Room AI API
Build with AI-powered room design. Integrate 18 generation models into your application with a single REST endpoint.
Quick Start
Make a request
POST to /api/v1/generate with your model and parameters.
Get the result
Receive a hosted image URL in the response. Images are hosted for 30 days.
curl -X POST https://roomai.com/api/v1/generate \
-H "Authorization: Bearer rai_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "interior",
"image": "https://example.com/room.jpg",
"styles": "modern",
"knows": "living room"
}'Base URL
https://roomai.com/api/v1Authentication
All API requests require an API key sent in the Authorization header as a Bearer token.
curl -H "Authorization: Bearer rai_live_your_api_key_here" \
https://roomai.com/api/v1/generateAPI keys can be created and managed in the Developer Dashboard. Keys are shown once upon creation — store them securely.
Generators
18 AI models available through a single endpoint. Click a model to see its full documentation with parameters, examples, and tips.
Interior
Exterior
Tools
magicwandReplace specific furniture using a mask
removefurnitureRemove all furniture from a room
enhanceUpscale and enhance image quality (2x/4x/8x)
removebgRemove image background
changebgReplace background with AI
sketchConvert sketches to photorealistic renders
magicpromptTransform images using text prompts
expandExtend cropped photos with AI outpainting
patternGenerate seamless tileable textures
vectorExport precise SVG vector drawings
3D
POST /generate
The main generation endpoint. Send a model name and parameters to generate an image.
POST /api/v1/generateRequest Body
{
"model": "interior",
"image": "https://example.com/room.jpg",
"styles": "modern",
"knows": "living room",
"prompt": "modern minimalist design",
"precise": "50",
"format": "png"
}Response
{
"status": "success",
"result": {
"image_url": "https://storage.googleapis.com/...",
"model": "interior",
"tokens_used": 1,
"processing_time_ms": 4500
}
}GET /results
Optional endpoint for polling async generation results. The /generate endpoint handles polling server-side by default, but this endpoint is available if you want to manage polling yourself.
GET /api/v1/results?processing_url=https://...Common Parameters
Parameters shared across most generators. See individual model pages for model-specific parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Required | The generator model to use (see Generators above) |
image | string | Required | URL of the input image (not needed for text-to-image models like fluw and pattern) |
prompt | string | Optional | Text description of the desired output |
styles | string | Optional | Design style (e.g. modern, minimalist, scandinavian). 99+ styles available. |
knows | string | Optional | Room/building type (e.g. living room, bedroom, house exterior) |
precise | string | Optional | AI strength from "0" to "100". Higher values preserve more of the original. |
format | string | Optional | Output format — "png" (default) |
seed | number | Optional | Random seed for reproducible results |
webhook | string | Optional | URL for async result delivery (see Webhooks section) |
Response Format
Success (200)
{
"status": "success",
"result": {
"image_url": "https://...",
"model": "interior",
"tokens_used": 1,
"processing_time_ms": 4500
}
}Error Codes
| Code | Error | Description |
|---|---|---|
| 400 | INVALID_MODEL | Unknown model value |
| 401 | UNAUTHORIZED | Invalid or missing API key |
| 402 | INSUFFICIENT_TOKENS | Not enough tokens in your balance |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests — retry after cooldown |
| 500 | GENERATION_FAILED | Generation failed — tokens refunded |
Error Response Format
{
"status": "error",
"error": {
"code": "INSUFFICIENT_TOKENS",
"message": "Not enough tokens",
"required": 1,
"balance": 0
}
}Rate Limits
Each API key has a default rate limit of 60 requests per minute. If you exceed this limit, the API will return a 429 status with a retryAfter value in seconds.
Need higher limits? Contact us at api@roomai.com.
Code Examples
cURL
curl -X POST https://roomai.com/api/v1/generate \
-H "Authorization: Bearer rai_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "interior",
"image": "https://example.com/room.jpg",
"styles": "modern",
"knows": "living room"
}'JavaScript / Node.js
const response = await fetch("https://roomai.com/api/v1/generate", {
method: "POST",
headers: {
"Authorization": "Bearer rai_live_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "interior",
image: "https://example.com/room.jpg",
styles: "modern",
knows: "living room",
}),
});
const data = await response.json();
if (data.status === "success") {
console.log("Image URL:", data.result.image_url);
console.log("Tokens used:", data.result.tokens_used);
} else {
console.error("Error:", data.error.message);
}Python
import requests
response = requests.post(
"https://roomai.com/api/v1/generate",
headers={
"Authorization": "Bearer rai_live_your_api_key",
"Content-Type": "application/json",
},
json={
"model": "interior",
"image": "https://example.com/room.jpg",
"styles": "modern",
"knows": "living room",
},
)
data = response.json()
if data["status"] == "success":
print("Image URL:", data["result"]["image_url"])
else:
print("Error:", data["error"]["message"])Webhooks
For long-running generations (like Video AI), you can provide a webhook URL in your request. The API will return immediately with a job ID and POST the final result to your webhook URL when complete.
Request
{
"model": "video",
"image": "https://example.com/room.jpg",
"webhook": "https://your-app.com/webhook/roomai"
}Immediate Response
{
"status": "processing",
"jobId": "api_1234567890_abc123"
}Webhook Payload
{
"status": "success",
"jobId": "api_1234567890_abc123",
"result": {
"image_url": "https://...",
"model": "video",
"tokens_used": 10,
"processing_time_ms": 45000
}
}Webhook delivery is retried up to 3 times with exponential backoff on failure.
Image Hosting
Generated images are hosted on Firebase Storage and accessible via signed URLs. URLs expire after 30 days. Download and store images on your own infrastructure if you need them longer.