3DGen AI
3 tokens3DGenerate exportable 3D models from images
Overview
Generate 3D models from photos. Upload an image of a furniture piece or object and the AI generates a 3D model that can be exported and used in 3D modeling software, game engines, or AR/VR applications. Provide multiple angle photos for improved accuracy.
Image input
Endpoint
POST /api/v1/generatebash
curl -X POST https://roomai.com/api/v1/generate \
-H "Authorization: Bearer rai_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"model": "3dgen", ...}'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Required | Must be "3dgen". 3dgen |
image | string | Required | URL of the primary image (front view recommended). |
prompt | string | Optional | Describe the object for better 3D interpretation (e.g. "a round wooden dining table"). |
extra_image_1 | string | Optional | URL of a second angle photo (side view). |
extra_image_2 | string | Optional | URL of a third angle photo (back or top view). |
extra_image_3 | string | Optional | URL of a fourth angle photo. |
format | string | Optional | Output format. Default: png |
Request Example
json
{
"model": "3dgen",
"image": "https://example.com/chair-front.jpg",
"prompt": "a modern accent chair with wooden legs",
"extra_image_1": "https://example.com/chair-side.jpg",
"extra_image_2": "https://example.com/chair-back.jpg"
}Response
Success (200)
json
{
"status": "success",
"result": {
"image_url": "https://storage.googleapis.com/...",
"model": "3dgen",
"tokens_used": 3,
"processing_time_ms": 4500
}
}Error
json
{
"status": "error",
"error": {
"code": "INSUFFICIENT_TOKENS",
"message": "Not enough tokens",
"required": 3,
"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": "3dgen",
"image": "https://example.com/chair-front.jpg",
"prompt": "a modern accent chair with wooden legs",
"extra_image_1": "https://example.com/chair-side.jpg",
"extra_image_2": "https://example.com/chair-back.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": "3dgen",
"image": "https://example.com/chair-front.jpg",
"prompt": "a modern accent chair with wooden legs",
"extra_image_1": "https://example.com/chair-side.jpg",
"extra_image_2": "https://example.com/chair-back.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": "3dgen",
"image": "https://example.com/chair-front.jpg",
"prompt": "a modern accent chair with wooden legs",
"extra_image_1": "https://example.com/chair-side.jpg",
"extra_image_2": "https://example.com/chair-back.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
- 1Provide 2-3 angle photos for significantly better 3D model accuracy.
- 2Clean backgrounds (white or solid color) help the AI isolate the object.
- 3Costs 3 tokens per generation due to the computational complexity.
- 4Include a descriptive prompt to help the AI understand the object geometry.