Room AI

Room AI API

Build with AI-powered room design. Integrate 18 generation models into your application with a single REST endpoint.

Quick Start

1

Get an API key

Sign up and create an API key in the Developer Dashboard.

2

Make a request

POST to /api/v1/generate with your model and parameters.

3

Get the result

Receive a hosted image URL in the response. Images are hosted for 30 days.

bash
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/v1

Authentication

All API requests require an API key sent in the Authorization header as a Bearer token.

bash
curl -H "Authorization: Bearer rai_live_your_api_key_here" \
  https://roomai.com/api/v1/generate

API 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.

POST /generate

The main generation endpoint. Send a model name and parameters to generate an image.

POST /api/v1/generate

Request Body

json
{
  "model": "interior",
  "image": "https://example.com/room.jpg",
  "styles": "modern",
  "knows": "living room",
  "prompt": "modern minimalist design",
  "precise": "50",
  "format": "png"
}

Response

json
{
  "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.

ParameterTypeDescription
modelstringThe generator model to use (see Generators above)
imagestringURL of the input image (not needed for text-to-image models like fluw and pattern)
promptstringText description of the desired output
stylesstringDesign style (e.g. modern, minimalist, scandinavian). 99+ styles available.
knowsstringRoom/building type (e.g. living room, bedroom, house exterior)
precisestringAI strength from "0" to "100". Higher values preserve more of the original.
formatstringOutput format — "png" (default)
seednumberRandom seed for reproducible results
webhookstringURL for async result delivery (see Webhooks section)

Response Format

Success (200)

json
{
  "status": "success",
  "result": {
    "image_url": "https://...",
    "model": "interior",
    "tokens_used": 1,
    "processing_time_ms": 4500
  }
}

Error Codes

CodeErrorDescription
400INVALID_MODELUnknown model value
401UNAUTHORIZEDInvalid or missing API key
402INSUFFICIENT_TOKENSNot enough tokens in your balance
429RATE_LIMIT_EXCEEDEDToo many requests — retry after cooldown
500GENERATION_FAILEDGeneration failed — tokens refunded

Error Response Format

json
{
  "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

bash
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

javascript
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

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

json
{
  "model": "video",
  "image": "https://example.com/room.jpg",
  "webhook": "https://your-app.com/webhook/roomai"
}

Immediate Response

json
{
  "status": "processing",
  "jobId": "api_1234567890_abc123"
}

Webhook Payload

json
{
  "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.