> ## Documentation Index
> Fetch the complete documentation index at: https://docs.imagine.art/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Create an API key, submit an image generation, and poll until it finishes.

Three steps take you from a new key to a finished image.

## 1. Get a key

Create a key under **API keys** at [https://open.imagine.art/keys](https://open.imagine.art/keys). Keep it on your server, never in browser or app code.

```bash theme={null}
export IMAGINE_API_KEY="your-api-key"
```

## 2. Submit a generation

```bash theme={null}
curl -X POST https://api.imagine.art/v1/image/generate \
  -H "Authorization: Bearer $IMAGINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "imagineart-2.0",
    "input": {
      "prompt": "A red convertible above Cinque Terre at golden hour",
      "aspect_ratio": "16:9"
    }
  }'
```

The API answers `202` at once with an `id` and `data.status` set to `pending`.

## 3. Poll until it finishes

```bash theme={null}
curl https://api.imagine.art/v1/generations/{id}/status \
  -H "Authorization: Bearer $IMAGINE_API_KEY"
```

Response · 200:

```json theme={null}
{
  "status": "success",
  "data": {
    "id": "9e9f558c-4b4e-40fd-b67e-8617906c2cd1",
    "status": "completed",
    "images": [{ "url": "https://cdn.imagine.art/..." }]
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.