> ## 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 Editing API

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

```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."
  }
}
```


## OpenAPI

````yaml post /v1/images/edits
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/edits:
    post:
      tags:
        - Images
      summary: >-
        Creates an edited or extended image given an original image and a
        prompt.
      description: >-
        Given a prompt and an original image, the model will generate a new
        image.
      operationId: edits_v1_images_edits_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_edits_v1_images_edits_post'
        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:
    Body_edits_v1_images_edits_post:
      properties:
        image:
          type: string
          format: binary
          title: Image
          description: The image to be edited.
        prompt:
          type: string
          title: Prompt
          description: A text description of the desired image(s).
        model:
          type: string
          title: Model
          description: The model to use for image editing.
        'n':
          type: integer
          maximum: 10
          minimum: 1
          title: 'N'
          description: The number of images to generate. Must be between 1 and 10.
          default: 1
        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
        user:
          anyOf:
            - type: string
            - type: 'null'
          title: User
          description: A unique identifier representing your end-user
      type: object
      required:
        - image
        - prompt
        - model
      title: Body_edits_v1_images_edits_post
    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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.