## Base URL

All Generations API requests are made to:

```
https://api.modelstack.cc/v1/generations
```

## Supported Formats

The Generations API uses a unified JSON format across all supported providers. Just set the model and generation type — we handle the provider translation.

## Available Endpoints

| Method | Endpoint              | Description                              |
| ------ | --------------------- | ---------------------------------------- |
| `POST` | `/v1/generations`     | Create a new image or video generation   |
| `GET`  | `/v1/generations`     | List generations with pagination         |
| `GET`  | `/v1/generations/:id` | Get generation status and result         |
| `DELETE`| `/v1/generations/:id`| Delete a completed or failed generation  |

## Authentication

All requests require an API key passed via the `Authorization` header:

```
Authorization: Bearer your_api_key
```

API keys are created and managed from your [dashboard](https://modelstack.cc/dashboard/api-keys).

## Rate Limits

There is currently no enforced rate limit on the Generations API — don't build against a specific
requests-per-minute figure. Your effective throughput is bounded by your account balance, since every
generation is billed on creation.

## Request Format

All requests use JSON. Set the `Content-Type` header:

```
Content-Type: application/json
```

## Image/Video Generation

Generations are created asynchronously:

1. **POST** `/v1/generations` — returns immediately with a generation ID
2. **Poll** `GET /v1/generations/:id` — check until `status` is `completed` or `failed`
3. **Download** — `outputMediaUrls` on the completed generation holds storage keys, not direct URLs; exchange each key for a signed download URL via `GET /v1/media/presigned-url?key=...` (expires after 1 hour)

## SDK Support

The Generations API works with any HTTP client. See the [API Reference](/docs/api-reference/generations) for code examples.
