Skip to main content

cURL Examples

Stage an Image

# 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

curl https://stagingspaces-production-6fb7.up.railway.app/api/v1/credits \
  -H "Authorization: Bearer sk_live_xxxxxxxxxxxxx"

Enhance to 4K

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

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

curl https://stagingspaces-production-6fb7.up.railway.app/api/health

Batch Stage (Bash Script)

#!/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

# 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"