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

# Image Generation

> Create images from text descriptions using AI models

The Image Generation endpoint allows you to create images from text descriptions using various AI models.

<Card title="Authentication Required" icon="key" href="/api-reference/endpoint/get-api">
  Learn how to get your API key to use this endpoint
</Card>

### Models

Available models:

* `dall-e-3`
* `dall-e-2`
* `stable-diffusion-xl`

### Parameters

<ParamField body="prompt" type="string" required>
  Text description of the desired image
</ParamField>

<ParamField body="n" type="integer" default="1">
  Number of images to generate
</ParamField>

<ParamField body="size" type="string" default="1024x1024">
  Size of the generated images. Options: `1024x1024`, `1024x1792`, `1792x1024`
</ParamField>

<ParamField body="quality" type="string" default="standard">
  Image quality. Options: `standard`, `hd`
</ParamField>

<ParamField body="style" type="string" default="natural">
  Image style. Options: `natural`, `vivid`
</ParamField>

### Example Request

```bash theme={null}
curl --location 'https://api.gately.ai/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
    "prompt": "a white siamese cat",
    "n": 1,
    "size": "1024x1024",
    "model": "dall-e-3",
    "quality": "standard",
    "style": "natural"
}'
```

### Example Response

```json theme={null}
{
    "created": 1737411800,
    "data": [
        {
            "revised_prompt": "Visualize a Siamese cat with a predominantly white coat...",
            "url": "https://example.com/image.png"
        }
    ]
}
```


## OpenAPI

````yaml POST /v1/images/generations
openapi: 3.0.1
info:
  title: TaamCloud API
  description: >-
    A collection of AI services including chat, embeddings, reranking, and media
    generation
  version: 1.0.0
servers:
  - url: https://api.gately.ai
    description: Main API server
  - url: https://uploud.taam.cloud
    description: File Processing server
security:
  - bearerAuth: []
paths:
  /v1/images/generations:
    post:
      tags:
        - Images
      summary: Generate images
      description: Create images from text descriptions
      operationId: images
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequest'
            examples:
              Simple:
                value:
                  prompt: A beautiful sunset over a calm ocean
                  'n': 1
                  size: 1024x1024
                  model: dall-e-3
      responses:
        '200':
          description: Generated images
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
components:
  schemas:
    ImageGenerationRequest:
      type: object
      required:
        - prompt
      properties:
        prompt:
          type: string
          description: Text description of the desired image
        'n':
          type: integer
          description: Number of images to generate
          default: 1
        size:
          type: string
          enum:
            - 1024x1024
            - 1024x1792
            - 1792x1024
          default: 1024x1024
        model:
          type: string
          enum:
            - dall-e-3
          default: dall-e-3
        quality:
          type: string
          enum:
            - standard
            - hd
          default: standard
        style:
          type: string
          enum:
            - natural
            - vivid
          default: natural
    ImageGenerationResponse:
      type: object
      properties:
        created:
          type: integer
        data:
          type: array
          items:
            type: object
            properties:
              revised_prompt:
                type: string
              url:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Enter your API key prefixed with 'Bearer '

````