Ruwana Developer Documentation
Image API: Creative, Product and Polish.
The Image API exposes three distinct production contracts. Creative can run from JSON or visual references; Product and Polish require exactly one uploaded source image.
Endpoint contracts
| Mode | Endpoint | Reference rule | Prompt |
|---|---|---|---|
| Creative | POST /v1/lab/creative | 0 refs with JSON; 1–16 with multipart | Required |
| Product | POST /v1/lab/product | Exactly 1 multipart image | Optional |
| Polish | POST /v1/lab/polish | Exactly 1 multipart image | Optional |
Common fields
| Field | Values | Default / rule |
|---|---|---|
resolution | 1K · 2K · 4K | 1K |
aspect | 1:1 · 3:2 · 4:5 · 9:16 · 16:9 | 1:1 |
count | 1–4 integer | 1 |
references[] | PNG · JPEG · WebP | Multipart only; max 16 MB each |
Idempotency-Key | 8–128 characters | Required header |
Pricing and delivery
| Mode | 1K | 2K | 4K |
|---|---|---|---|
| Creative | $0.12 | $0.14 | $0.16 |
| Creative + references | $0.15 | $0.17 | $0.19 |
| Product | $0.15 | $0.17 | $0.19 |
| Polish | $0.15 | $0.17 | $0.19 |
Per output. Delivery: 1K PNG; 2K PNG + TIFF; 4K PNG + TIFF + DNG rendered-pixel derivative.
Creative — JSON example
cURL
curl https://platform.ruwana.studio/v1/lab/creative \
-H "Authorization: Bearer $RUWANA_API_KEY" \
-H "Idempotency-Key: creative-001" \
-H "Content-Type: application/json" \
-d '{"prompt":"Editorial still life with restrained luxury lighting","resolution":"1K","aspect":"4:5","count":1}'Node.js
const response = await fetch('https://platform.ruwana.studio/v1/lab/creative', {
method: 'POST',
headers: {
Authorization: 'Bearer ' + process.env.RUWANA_API_KEY,
'Idempotency-Key': 'creative-001',
'Content-Type': 'application/json'
},
body: JSON.stringify({
prompt: 'Editorial still life with restrained luxury lighting',
resolution: '1K', aspect: '4:5', count: 1
})
});
console.log(await response.json());Python
import os, requests
response = requests.post(
'https://platform.ruwana.studio/v1/lab/creative',
headers={
'Authorization': 'Bearer ' + os.environ['RUWANA_API_KEY'],
'Idempotency-Key': 'creative-001'
},
json={
'prompt': 'Editorial still life with restrained luxury lighting',
'resolution': '1K', 'aspect': '4:5', 'count': 1
}
)
print(response.json())Product and Polish — multipart examples
# Product
curl https://platform.ruwana.studio/v1/lab/product \
-H "Authorization: Bearer $RUWANA_API_KEY" \
-H "Idempotency-Key: product-001" \
-F "references[]=@product.webp" \
-F "prompt=Clean premium catalog composition" \
-F "resolution=2K" -F "aspect=4:5" -F "count=1"
# Polish
curl https://platform.ruwana.studio/v1/lab/polish \
-H "Authorization: Bearer $RUWANA_API_KEY" \
-H "Idempotency-Key: polish-001" \
-F "references[]=@source.jpg" \
-F "resolution=2K" -F "count=1"