Vector AI
1 tokenToolsExport precise SVG vector drawings
Overview
Vector AI converts photos and images into clean vector drawings. The output is a simplified, line-art style rendering suitable for architectural plans, technical illustrations, or design documentation. The result can be used as a starting point for further editing in vector graphics software.
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": "vector", ...}'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Required | Must be "vector". vector |
image | string | Required | URL of the image to vectorize. |
format | string | Optional | Output format. Default: png |
Request Example
json
{
"model": "vector",
"image": "https://example.com/room-photo.jpg"
}Response
Success (200)
json
{
"status": "success",
"result": {
"image_url": "https://storage.googleapis.com/...",
"model": "vector",
"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": "vector",
"image": "https://example.com/room-photo.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": "vector",
"image": "https://example.com/room-photo.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": "vector",
"image": "https://example.com/room-photo.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
- 1Works best with images that have clear lines and defined shapes.
- 2Use the output as a base for architectural floor plans or design concept sketches.
- 3Photos with good lighting and contrast produce cleaner vector conversions.