# PixelStudio API Documentation

Image processing service for AI agents.

## Setup

See [Setup](./setup.md) for installation and configuration instructions.

## Quick Reference

| Task | Endpoint | Price | Documentation |
|------|----------|-------|---------------|
| Celebrity Selfie Generator | `POST /api/celebrity-selfie/generate` | $0.10 | [Details](./celebrity-selfie-generate.md) |
| Photo Restoration | `POST /api/photo-restoration/restore` | $0.10 | [Details](./photo-restoration-restore.md) |
| Hairstyle Changer | `POST /api/hairstyle-changer/change` | $0.10 | [Details](./hairstyle-changer-change.md) |
| Headshot Generator | `POST /api/headshot/generate` | $0.10 | [Details](./headshot-generate.md) |
| Floor Plan Generator | `POST /api/floor-plan/generate` | $0.10 | [Details](./floor-plan-generate.md) |
| Clothes Changer | `POST /api/clothes-changer/change` | $0.10 | [Details](./clothes-changer-change.md) |
| Background Remover | `POST /api/background-remover/remove` | $0.10 | [Details](./background-remover.md) |
| Photo Colorizer | `POST /api/photo-colorizer/colorize` | $0.10 | [Details](./photo-colorizer.md) |
| Texture Generator | `POST /api/texture-generator/generate` | $0.10 | [Details](./texture-generator-generate.md) |
| Architectural Rendering | `POST /api/architectural-rendering/generate` | $0.10 | [Details](./architectural-rendering.md) |
| Product Staging | `POST /api/product-staging/generate` | $0.10 | [Details](./product-staging.md) |
| Sprite Sheet Generator | `POST /api/sprite-sheet-generator/generate` | $0.10 | [Details](./sprite-sheet-generator.md) |
| Pencil Drawing | `POST /api/pencil-drawing/generate` | $0.10 | [Details](./pencil-drawing.md) |
| Interior Design | `POST /api/interior-design/generate` | $0.10 | [Details](./interior-design.md) |
| Style Transfer | `POST /api/style-transfer/transfer` | $0.10 | [Details](./style-transfer.md) |
| Face Pixelation | `POST /api/face-pixelation/pixelate` | $0.10 | [Details](./face-pixelation.md) |
| Object Remover | `POST /api/object-remover/remove` | $0.10 | [Details](./object-remover.md) |
| Material Changer | `POST /api/material-changer/change` | $0.10 | [Details](./material-changer.md) |

## Examples

All APIs are protected by x402 payments. Use [x402-proxy](https://github.com/cascade-protocol/x402-proxy) for automatic payment handling.

### Celebrity Selfie Generator

```bash
npx x402-proxy -X POST \
  -F "image=@photo.jpg" \
  -F "celebrityName=Taylor Swift" \
  -F "sceneDescription=On stage at a concert" \
  -F "selfieStyle=concert selfie" \
  https://ps.codejar.net/api/celebrity-selfie/generate
```

### Photo Restoration

```bash
npx x402-proxy -X POST \
  -F "image=@old-photo.jpg" \
  -F "restorationInstructions=Fix scratches and restore colors" \
  -F "outputFormat=png" \
  https://ps.codejar.net/api/photo-restoration/restore
```

### Hairstyle Changer

```bash
npx x402-proxy -X POST \
  -F "image=@photo.jpg" \
  -F "hairstyleDescription=Long wavy auburn hair" \
  -F "aspectRatio=1:1" \
  https://ps.codejar.net/api/hairstyle-changer/change
```

### Headshot Generator

```bash
npx x402-proxy -X POST \
  -F "image=@photo.jpg" \
  -F "headshotStyle=LinkedIn profile" \
  -F "outputFormat=webp" \
  https://ps.codejar.net/api/headshot/generate
```

### Floor Plan Generator

```bash
npx x402-proxy -X POST \
  -F "image=@sketch.jpg" \
  -F "styleDescription=Modern minimalist" \
  -F "viewType=2d-top-down" \
  https://ps.codejar.net/api/floor-plan/generate
```

### Clothes Changer

```bash
npx x402-proxy -X POST \
  -F "subject=@person.jpg" \
  -F "clothing=@denim-jacket.jpg" \
  -F "aspectRatio=1:1" \
  https://ps.codejar.net/api/clothes-changer/change
```

### Background Remover

```bash
npx x402-proxy -X POST \
  -F "image=@photo.jpg" \
  https://ps.codejar.net/api/background-remover/remove
```

### Photo Colorizer

```bash
npx x402-proxy -X POST \
  -F "image=@black-and-white-photo.jpg" \
  https://ps.codejar.net/api/photo-colorizer/colorize
```

### Texture Generator

```bash
npx x402-proxy -X POST \
  -H "Content-Type: application/json" \
  -d '{"textureDescription":"weathered red brick with moss","textureType":"brick"}' \
  https://ps.codejar.net/api/texture-generator/generate
```

### Architectural Rendering

```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
```

### Product Staging

```bash
npx x402-proxy -X POST \
  -F "product=@sneaker.png" \
  -F "background=@boutique.jpg" \
  -F "sceneDescription=luxury boutique" \
  https://ps.codejar.net/api/product-staging/generate
```

### Sprite Sheet Generator

```bash
npx x402-proxy -X POST \
  -F "image=@character.png" \
  -F "characterDescription=robot warrior" \
  -F "sheetType=walk" \
  https://ps.codejar.net/api/sprite-sheet-generator/generate
```

### Pencil Drawing

```bash
npx x402-proxy -X POST \
  -F "image=@photo.jpg" \
  https://ps.codejar.net/api/pencil-drawing/generate
```

### Interior Design

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

### Style Transfer

```bash
npx x402-proxy -X POST \
  -F "content=@landscape.jpg" \
  -F "styleDescription=Van Gogh Starry Night" \
  https://ps.codejar.net/api/style-transfer/transfer
```

### Face Pixelation

```bash
npx x402-proxy -X POST \
  -F "image=@photo.jpg" \
  https://ps.codejar.net/api/face-pixelation/pixelate
```

### Object Remover

```bash
npx x402-proxy -X POST \
  -F "image=@photo.jpg" \
  -F "targetDescription=the person on the left" \
  https://ps.codejar.net/api/object-remover/remove
```

### Material Changer

```bash
npx x402-proxy -X POST \
  -F "image=@living-room.jpg" \
  -F "targetDescription=the sofa" \
  -F "materialDescription=luxury red leather" \
  https://ps.codejar.net/api/material-changer/change
```

## Health Check

```bash
curl -X GET https://ps.codejar.net/health
```
