> ## Documentation Index
> Fetch the complete documentation index at: https://openrouter.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.
# ImageGenerationRequest
Image generation request input
## Example Usage
```typescript theme={null}
import { ImageGenerationRequest } from "@openrouter/sdk/models";
let value: ImageGenerationRequest = {
model: "bytedance-seed/seedream-4.5",
prompt: "a red panda astronaut floating in space, studio lighting",
};
```
## Fields
| Field | Type | Required | Description | Example |
| ------------------- | --------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- |
| `aspectRatio` | [models.ImageGenerationRequestAspectRatio](../models/imagegenerationrequestaspectratio.mdx) | :heavy\_minus\_sign: | Normalized aspect ratio of the generated image. Providers clamp to their supported subset. | 16:9 |
| `background` | [models.ImageGenerationRequestBackground](../models/imagegenerationrequestbackground.mdx) | :heavy\_minus\_sign: | Background treatment. `transparent` requires an output\_format that supports alpha (png or webp). | auto |
| `inputReferences` | [models.ContentPartImage](../models/contentpartimage.mdx)\[] | :heavy\_minus\_sign: | Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. | |
| `model` | *string* | :heavy\_check\_mark: | The image generation model to use | bytedance-seed/seedream-4.5 |
| `n` | *number* | :heavy\_minus\_sign: | Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1. | 1 |
| `outputCompression` | *number* | :heavy\_minus\_sign: | Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. | 100 |
| `outputFormat` | [models.ImageGenerationRequestOutputFormat](../models/imagegenerationrequestoutputformat.mdx) | :heavy\_minus\_sign: | Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. | png |
| `prompt` | *string* | :heavy\_check\_mark: | Text description of the desired image | a red panda astronaut floating in space, studio lighting |
| `provider` | [models.ImageGenerationProviderPreferences](../models/imagegenerationproviderpreferences.mdx) | :heavy\_minus\_sign: | Provider routing preferences and provider-specific passthrough configuration. | \{
"allow\_fallbacks": false,
"only": \[
"google-ai-studio"
]
} |
| `quality` | [models.ImageGenerationRequestQuality](../models/imagegenerationrequestquality.mdx) | :heavy\_minus\_sign: | Rendering quality. Providers without a quality knob ignore this. | high |
| `resolution` | [models.ImageGenerationRequestResolution](../models/imagegenerationrequestresolution.mdx) | :heavy\_minus\_sign: | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K |
| `seed` | *number* | :heavy\_minus\_sign: | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | |
| `size` | *string* | :heavy\_minus\_sign: | Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400. | 2K |
| `stream` | *boolean* | :heavy\_minus\_sign: | If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. | |
| `user` | *string* | :heavy\_minus\_sign: | A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier. | end-user-abc123 |