---
title: "Start a generation"
method: POST
path: "/generations"
tags: ["Generations"]
---

# Start a generation

`POST /generations`

## Request

- Base URL: `https://www.rainbrand.com/api/v1`
- URL: `https://www.rainbrand.com/api/v1/generations`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer
  - OAuth 2
    - Authorization code: `https://www.rainbrand.com/api/auth/oauth2/authorize`
    - Token URL: `https://www.rainbrand.com/api/auth/oauth2/token`

Generate a file with a selected model. A Brand ID scopes the request; pass a completed Brief to a supported model to include brand guidance and assets. Retrieve outputs with [Get a generation](/api-reference/generations/get-a-generation).

## Headers

- `idempotency-key` string: Optional key for safely retrying this request. Reuse it only with the same body to get the original generation back; use a new key for a new generation.

## Request body

- object
  - `brandSessionId` string, uuid, required: Brand this generation belongs to.
  - `model` string, required: Exact model ID returned by GET /models.
  - `input` object, required: Input matching the model's inputSchema.
  - `briefId` string, uuid: Completed Brief to use for image or video generation with a supported model. Rainbrand adds its guidance before your prompt and its visual assets after any references you provide.

## Response `202`

OK

- object
  - `data` object, required
    - `id` string, uuid, required: Generation ID returned when the request started.
    - `status` 'pending' | 'generating' | 'completed' | 'failed', required: Current generation status.

## Other responses

- `400`: 400
- `401`: 401
- `402`: 402
- `403`: 403
- `404`: 404
- `409`: 409
- `429`: 429
- `500`: 500
- `503`: 503

---

[API](https://skmtc.dev/rainbrand/apis/rainbrand-api.md) - [All operations](https://skmtc.dev/rainbrand/apis/rainbrand-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rainbrand/apis/rainbrand-api/revisions/012b8e9da4df?raw)
