cURL Examples
Stage an Image
Copy
Ask AI
# Basic staging
curl -X POST https://stagingspaces-production-6fb7.up.railway.app/api/v1/stage \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxx" \
-F "image=@empty_room.jpg" \
-F "style=modern"
# With all options
curl -X POST https://stagingspaces-production-6fb7.up.railway.app/api/v1/stage \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxx" \
-F "image=@empty_room.jpg" \
-F "style=scandinavian" \
-F "room_type=living_room" \
-F "product_placement=true" \
-F "enhance_output=true"
Check Credits
Copy
Ask AI
curl https://stagingspaces-production-6fb7.up.railway.app/api/v1/credits \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxx"
Enhance to 4K
Copy
Ask AI
curl -X POST https://stagingspaces-production-6fb7.up.railway.app/api/v1/enhance \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxx" \
-F "image=@staged_room.jpg" \
-F "preset=default"
Add Product Placement
Copy
Ask AI
curl -X POST https://stagingspaces-production-6fb7.up.railway.app/api/v1/place-products \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxx" \
-F "image=@staged_room.jpg" \
-F "room_type=living_room"
Health Check
Copy
Ask AI
curl https://stagingspaces-production-6fb7.up.railway.app/api/health
Batch Stage (Bash Script)
Copy
Ask AI
#!/bin/bash
API_KEY="sk_live_xxxxxxxxxxxxx"
BASE_URL="https://stagingspaces-production-6fb7.up.railway.app"
STYLE="modern"
for image in ./property_photos/*.jpg; do
echo "Staging: $image"
result=$(curl -s -X POST "$BASE_URL/api/v1/stage" \
-H "Authorization: Bearer $API_KEY" \
-F "image=@$image" \
-F "style=$STYLE")
claim_code=$(echo "$result" | jq -r '.claim_code')
echo " → Claim code: $claim_code"
done
Download Staged Image
Copy
Ask AI
# Extract URL from staging response and download
IMAGE_URL=$(curl -s -X POST .../api/v1/stage \
-H "Authorization: Bearer $API_KEY" \
-F "image=@room.jpg" \
-F "style=modern" | jq -r '.image_url')
curl -o staged_room.jpg "$IMAGE_URL"