# Interior Design

Generate interior design visualizations from empty room images or descriptions.

## Description

Upload an empty room photo, floor plan, or provide a design description and generate a photorealistic interior design visualization with realistic furniture, lighting, decor, color schemes, and materials. You can provide an image, a description, or both.

## Authentication

**Required**: x402 payment

This endpoint requires payment via the x402 protocol. See the [Setup](./setup.md) for setup instructions.

## Request

**Endpoint**: `POST /api/interior-design/generate`

**Content-Type**: `multipart/form-data`

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| image | file | No* | Empty room or floor plan image (JPG, PNG, or WebP, max 10MB) |
| designDescription | string | No* | Design description, e.g. "modern Scandinavian living room", "cozy Japanese bedroom" |
| viewAngle | string | No | View angle: `front` (default), `corner`, or `wide` |

\* At least one of `image` or `designDescription` must be provided. If both are provided, they will be combined to generate the result.

## Response

**200 OK**

```json
{
  "imageUrl": "/outputs/uuid-here.png"
}
```

| Field | Type | Description |
|-------|------|-------------|
| imageUrl | string | Path to the generated interior design visualization |

## Error Codes

| Status | Code | Description |
|--------|------|-------------|
| 400 | VALIDATION_ERROR | Invalid request parameters |
| 402 | PAYMENT_REQUIRED | x402 payment not completed |
| 413 | FILE_TOO_LARGE | File exceeds 10MB limit |
| 415 | UNSUPPORTED_FORMAT | Invalid file type (must be JPG, PNG, or WebP) |
| 422 | INVALID_IMAGE_DATA | Unable to process image or no image/description provided |
| 500 | INTERNAL_ERROR | AI generation failed |
| 504 | AI_GENERATION_TIMEOUT | AI request timed out |

## Example

### With image only

```bash
npx x402-proxy -X POST \
  -F "image=@empty-room.jpg" \
  -F "viewAngle=corner" \
  https://ps.codejar.net/api/interior-design/generate
```

### With description only

```bash
npx x402-proxy -X POST \
  -F "designDescription=Modern Scandinavian living room with natural wood and white walls" \
  https://ps.codejar.net/api/interior-design/generate
```

### With image and description

```bash
npx x402-proxy -X POST \
  -F "image=@empty-room.jpg" \
  -F "designDescription=Cozy Japanese bedroom with tatami and minimalist furniture" \
  -F "viewAngle=wide" \
  https://ps.codejar.net/api/interior-design/generate
```

**Response:**
```json
{
  "imageUrl": "/outputs/550e8400-e29b-41d4-a716-446655440005.png"
}
```
