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

# OpenAI Image Generate

> Generate images using OpenAI's gpt-image-1 model.

## Overview

Generate images using OpenAI's gpt-image-1 model.

* **Output Type**: image
* **Estimated Cost**: quality == "high" ? 16 : 8 credits
* **Handler**: local

## Parameters

### Required Parameters

<ParamField body="prompt" type="string" required>
  A visual description of your desired image.

  <Tip>
    Max length 32000 characters.
  </Tip>

  * Label: Prompt
</ParamField>

<ParamField body="size" type="string" required default="auto">
  The size of the generated images. Must be one of '1024x1024', '1536x1024' (landscape), '1024x1536' (portrait), or 'auto'. Defaults to auto.

  * Options: `1024x1024`, `1536x1024`, `1024x1536`, `auto`
</ParamField>

### Optional Parameters

<ParamField body="n_samples" type="integer" default={1}>
  Number of samples to generate

  <Tip>
    This is the number of tries to generate for the prompt.
    If you get a request for n\_samples > 1, you are still using a *single* prompt for the whole set.
  </Tip>

  * Label: Number of samples
  * Minimum: 1
  * Maximum: 4
</ParamField>

<ParamField body="quality" type="string" default="medium">
  The quality of the image (high, medium, low, auto). 'auto' selects the best quality. Defaults to auto.

  <Tip>
    Set this to high if you want to get the highest level of details, fidelity, and coherence, especially for complex scenes, infographics, or text-heavy images.
  </Tip>

  * Options: `high`, `medium`, `low`, `auto`
</ParamField>

<ParamField body="background" type="string" default="auto">
  Set background transparency (transparent, opaque, auto). 'transparent' requires output\_format='png' or 'webp'. Defaults to auto.

  * Options: `transparent`, `opaque`, `auto`
</ParamField>

<ParamField body="output_compression" type="integer" default={100}>
  Compression level (0-100) for webp/jpeg formats. Defaults to 100.
</ParamField>

<ParamField body="output_format" type="string" default="png">
  Output format for the generated image (png, jpeg, webp). Defaults to png. gpt-image-1 always returns images as base64-encoded data.

  * Options: `png`, `jpeg`, `webp`
</ParamField>

<ParamField body="user" type="string">
  A unique identifier representing your end-user for enabling per-user content monitoring.
</ParamField>
