Room AI

Magic Prompt AI

1 tokenTools

Transform images using text prompts

Overview

Magic Prompt AI lets you transform any image using natural language instructions. Describe what changes you want and the AI applies them — change colors, add elements, modify materials, or completely restyle a scene. You can provide up to 6 reference images to guide the style and composition.

Image input

Endpoint

POST /api/v1/generate
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": "magicprompt", ...}'

Parameters

ParameterTypeDescription
modelstring

Must be "magicprompt".

magicprompt
imagestring

URL of the base image to transform.

promptstring

Describe the transformation (e.g. "change the walls to exposed brick and add warm pendant lighting").

precisestring

AI strength from "0" to "100". Higher values stay closer to the original image.

Default: "50"

enhance_promptstring

Set to "true" to let the AI enhance your prompt.

Default: "false"

truefalse
extra_image_1string

URL of reference image 1 (up to 6 supported).

extra_image_2string

URL of reference image 2.

extra_image_3string

URL of reference image 3.

extra_image_4string

URL of reference image 4.

extra_image_5string

URL of reference image 5.

extra_image_6string

URL of reference image 6.

formatstring

Output format.

Default: "png"

png

Request Example

json
{
  "model": "magicprompt",
  "image": "https://example.com/room.jpg",
  "prompt": "change the walls to exposed brick and add warm pendant lighting",
  "precise": "40",
  "extra_image_1": "https://example.com/brick-reference.jpg"
}

Response

Success (200)

json
{
  "status": "success",
  "result": {
    "image_url": "https://storage.googleapis.com/...",
    "model": "magicprompt",
    "tokens_used": 1,
    "processing_time_ms": 4500
  }
}

Error

json
{
  "status": "error",
  "error": {
    "code": "INSUFFICIENT_TOKENS",
    "message": "Not enough tokens",
    "required": 1,
    "balance": 0
  }
}

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": "magicprompt",
  "image": "https://example.com/room.jpg",
  "prompt": "change the walls to exposed brick and add warm pendant lighting",
  "precise": "40",
  "extra_image_1": "https://example.com/brick-reference.jpg"
}'

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": "magicprompt",
  "image": "https://example.com/room.jpg",
  "prompt": "change the walls to exposed brick and add warm pendant lighting",
  "precise": "40",
  "extra_image_1": "https://example.com/brick-reference.jpg"
}),
});

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": "magicprompt",
  "image": "https://example.com/room.jpg",
  "prompt": "change the walls to exposed brick and add warm pendant lighting",
  "precise": "40",
  "extra_image_1": "https://example.com/brick-reference.jpg"
},
)

data = response.json()

if data["status"] == "success":
    print("Image URL:", data["result"]["image_url"])
    print("Tokens used:", data["result"]["tokens_used"])
else:
    print("Error:", data["error"]["message"])

Tips

  • 1Be specific in your prompt — mention materials, colors, lighting, and specific elements you want changed.
  • 2Use reference images (extra_image_1 through extra_image_6) to show the AI exactly what style you want.
  • 3Lower "precise" values (10-30) give the AI more creative freedom; higher values (70-90) keep more of the original image.
  • 4Great for quick iterations — describe incremental changes to refine a design.