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

# Image Generation API

> Tap into Galadriel's image generation network. Follows the same schema as OpenAI's image generation API.

<ResponseExample>
  ```json 200 theme={null}
  {
      "created": 1,
      "data": [
          {
              "b64_json": null,
              "revised_prompt": null,
              "url": "https://example.com/image"
          }
      ]
  }
  ```

  ```json 422 theme={null}
  {
    "detail": [
      {
        "loc": [
          "<string>"
        ],
        "msg": "<string>",
        "type": "<string>"
      }
    ]
  }
  ```

  ```json 429 theme={null}
  {
    "response": "NOK",
    "error": {
      "status_code": 429,
      "code": "rate_limit_exceeded",
      "message": "Rate limit exceeded"
    }
  }
  ```

  ```json 503 theme={null}
  {
    "response": "NOK",
    "error": {
      "status_code": 503,
      "code": "no_available_inference_nodes",
      "message": "No available inference nodes to process the request."
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml post /v1/images/generations
openapi: 3.1.0
info:
  title: API
  description: API version 1.0.0
  version: 1.0.0
  contact:
    name: ''
    email: kristjan@galadriel.com
  x-logo:
    url: ''
servers:
  - url: https://api.galadriel.com
security: []
paths:
  /v1/images/generations:
    post:
      tags:
        - Images
      summary: Creates an image given a prompt.
      description: Given a prompt, the model will generate a image.
      operationId: generations_v1_images_generations_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequest'
        required: true
      responses:
        '200':
          description: Returns a list of image objects.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    ImageGenerationRequest:
      properties:
        prompt:
          type: string
          title: Prompt
          description: text description of the desired image(s).
        model:
          type: string
          title: Model
          description: The model to use for image generation.
        'n':
          type: integer
          maximum: 10
          minimum: 1
          title: 'N'
          description: The number of images to generate. Must be between 1 and 10.
          default: 1
        quality:
          type: string
          enum:
            - standard
            - hd
          title: Quality
          description: The quality of the image that will be generated.
          default: standard
        response_format:
          type: string
          enum:
            - url
            - b64_json
          title: Response Format
          description: The format in which the generated images are returned.
          default: url
        size:
          type: string
          enum:
            - 256x256
            - 512x512
            - 1024x1024
          title: Size
          description: The size of the generated images.
          default: 1024x1024
        style:
          type: string
          enum:
            - vivid
            - natural
          title: Style
          description: The style of the generated images.
          default: vivid
        user:
          anyOf:
            - type: string
            - type: 'null'
          title: User
          description: A unique identifier representing your end-user
      type: object
      required:
        - prompt
        - model
      title: ImageGenerationRequest
      example:
        model: dall-e-3
        'n': 1
        prompt: a red apple
        quality: standard
        response_format: url
        size: 1024x1024
        style: vivid
        user: user123
    ImagesResponse:
      properties:
        created:
          type: integer
          title: Created
        data:
          items:
            $ref: '#/components/schemas/Image'
          type: array
          title: Data
      additionalProperties: true
      type: object
      required:
        - created
        - data
      title: ImagesResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Image:
      properties:
        b64_json:
          anyOf:
            - type: string
            - type: 'null'
          title: B64 Json
        revised_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Revised Prompt
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
      additionalProperties: true
      type: object
      title: Image
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: |-
        Bearer authentication header.

        example value: `Bearer Galadriel-API-key`

        Get API key from [Galadriel dashboard](https://dashboard.galadriel.com).
      in: header
      name: Authorization

````