# Public API

Call Restory JSON endpoints directly for restoration, image generation, video generation, uploads, credits, gallery, and job polling.

## Fast links

- Web page: https://www.restory.pics/agent/docs/public-api
- Markdown: https://www.restory.pics/api/agent/docs/markdown/public-api
- Capabilities JSON: https://www.restory.pics/api/agent/capabilities
- OpenAPI JSON: https://www.restory.pics/api/agent/openapi
- API keys: https://www.restory.pics/agent

## Base URL

```text
https://www.restory.pics
```

## Discovery

Discovery is public so agents can inspect supported workflows before authentication.

```http
GET /api/agent/capabilities
```

## OpenAPI

Use OpenAPI for generic API clients and keep capabilities JSON for current model and credit discovery.

```http
GET /api/agent/openapi
```

## Generation endpoints

| Endpoint | Use |
| --- | --- |
| `POST /api/restore-photo` | Fast restoration |
| `POST /api/repair-damage` | Repair scratches, missing parts, and damage |
| `POST /api/premium-ultra` | Premium 2K or 4K restoration |
| `POST /api/colorize-photo` | Colorization |
| `POST /api/restore-likeness` | Damaged image plus reference image |
| `POST /api/upscale-image` | Basic upscaling |
| `POST /api/generate-image` | Image generation and editing |
| `POST /api/generate-video` | Text, image, and reference video generation |
| `POST /api/upload-reference-media` | Upload image, video, or audio references |

## Polling and gallery

```http
GET /api/agent/jobs/{id}?type=image
GET /api/agent/jobs/{id}?type=video
GET /api/agent/gallery?type=image&status=completed&limit=20
```

## Errors

API errors return JSON with `success: false` and a readable `error`. Entitlement failures include `upgradeRequired` and `featureRequired` when relevant.