# Quickstart

Create an API key, install the CLI, discover capabilities, submit a job, and poll the result.

## Fast links

- Web page: https://www.restory.pics/agent/docs/quickstart
- Markdown: https://www.restory.pics/api/agent/docs/markdown/quickstart
- 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

## Install the CLI

The CLI is the fastest way for agents to use local files while still receiving structured JSON output.

```bash
npm install -g @restory/cli
```

## Set your API key

Create an API key on `/agent`, then store it in the agent environment.

```bash
export RESTORY_API_KEY="rst_..."
export RESTORY_BASE_URL="https://www.restory.pics"
```

## Run discovery

Agents should call discovery before choosing model-specific settings, durations, resolutions, aspect ratios, or restoration methods.

```bash
restory capabilities
restory credits
```

## Submit and poll

Generation routes queue jobs. Poll until the result is completed, then use the returned Bunny CDN URL.

```bash
restory restore --method fast --file ./old-photo.jpg
restory jobs:get <imageRecordId> --type image
```