Magic Prompt AI
1 tokenToolsTransform 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.
Endpoint
POST /api/v1/generatecurl -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
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Required | Must be "magicprompt". magicprompt |
image | string | Required | URL of the base image to transform. |
prompt | string | Required | Describe the transformation (e.g. "change the walls to exposed brick and add warm pendant lighting"). |
precise | string | Optional | AI strength from "0" to "100". Higher values stay closer to the original image. Default: |
enhance_prompt | string | Optional | Set to "true" to let the AI enhance your prompt. Default: truefalse |
extra_image_1 | string | Optional | URL of reference image 1 (up to 6 supported). |
extra_image_2 | string | Optional | URL of reference image 2. |
extra_image_3 | string | Optional | URL of reference image 3. |
extra_image_4 | string | Optional | URL of reference image 4. |
extra_image_5 | string | Optional | URL of reference image 5. |
extra_image_6 | string | Optional | URL of reference image 6. |
format | string | Optional | Output format. Default: png |
Request Example
{
"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)
{
"status": "success",
"result": {
"image_url": "https://storage.googleapis.com/...",
"model": "magicprompt",
"tokens_used": 1,
"processing_time_ms": 4500
}
}Error
{
"status": "error",
"error": {
"code": "INSUFFICIENT_TOKENS",
"message": "Not enough tokens",
"required": 1,
"balance": 0
}
}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": "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
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
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.