# Architectural Rendering

Generate photorealistic architectural visualizations from floor plans or sketches.

## Description

Upload a floor plan, sketch, or line drawing and generate a photorealistic 3D rendered architectural visualization showing building exteriors with realistic materials, landscaping, and lighting.

## Authentication

**Required**: x402 payment

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

## Request

**Endpoint**: `POST /api/architectural-rendering/generate`

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

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| image | file | Yes | Floor plan or architectural sketch (JPG, PNG, or WebP, max 10MB) |
| styleDescription | string | No | Style description, e.g. "modern minimalist villa" |
| viewType | string | No | View perspective: `exterior` (default), `aerial`, or `street-level` |

## Response

**200 OK**

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

| Field | Type | Description |
|-------|------|-------------|
| imageUrl | string | Path to the generated architectural rendering |

## 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 |
| 500 | INTERNAL_ERROR | AI generation failed |
| 504 | AI_GENERATION_TIMEOUT | AI request timed out |

## Example

```bash
npx x402-proxy -X POST \
  -F "image=@sketch.jpg" \
  -F "styleDescription=Modern minimalist villa" \
  -F "viewType=exterior" \
  https://ps.codejar.net/api/architectural-rendering/generate
```

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