> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stagingspaces.app/llms.txt
> Use this file to discover all available pages before exploring further.

# cURL

> cURL examples for the StagingSpaces API

# cURL Examples

## Stage an Image

```bash theme={null}
# 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

```bash theme={null}
curl https://stagingspaces-production-6fb7.up.railway.app/api/v1/credits \
  -H "Authorization: Bearer sk_live_xxxxxxxxxxxxx"
```

## Enhance to 4K

```bash theme={null}
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

```bash theme={null}
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

```bash theme={null}
curl https://stagingspaces-production-6fb7.up.railway.app/api/health
```

## Batch Stage (Bash Script)

```bash theme={null}
#!/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

```bash theme={null}
# 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"
```
