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

# Images Generations

> Official API reference for image generation workloads can be found on the corresponding models pages, upon clicking “view code”. We support generating images from text prompts, other images, and/or ControlNet.



## OpenAPI

````yaml https://dev-platform.algo-tech.ai/api/openapi post /v1/images/generations
openapi: 3.1.0
info:
  title: Algo API Documentation
  description: >-
    # Introduction

    Algo AI REST API enables you to interact with various Language, Image and
    Embedding Models using the API Key.


    # Authentication

    All requests made to the Algo AI via REST API must include an Authorization
    header.


    Header should specify a valid Bearer Token with API key and must be encoded
    as JSON with the “Content-Type: application/json” header.


    This ensures that your requests are properly authenticated and formatted for
    interaction with the Algo AI.


    A Sample header to be included in the REST API request should look like
    below:

    ```

    authorization: Bearer <API_KEY>

    ```
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.algo-tech.ai
security:
  - bearerAuth: []
paths:
  /v1/images/generations:
    post:
      summary: Images Generations
      description: >-
        Official API reference for image generation workloads can be found on
        the corresponding models pages, upon clicking “view code”. We support
        generating images from text prompts, other images, and/or ControlNet.
      parameters:
        - required: true
          name: Authorization
          description: >-
            Bearer authentication header of the form Bearer <API_KEY>, where
            <API_KEY> is your auth token.
          in: header
          schema:
            type: string
            default: Bearer <API_KEY>
        - name: Accept
          description: >-
            Specifies which format to return the response in. With `image/png`
            and `image/jpeg`, the server will populate the response body with a
            binary image of the specified format. With `application/json`, the
            server will populate the response body with schema {base64: [string,
            ...], finishReason: string enum [SUCCESS, CONTENT_FILTERED], seed:
            int}. `base64` contains a list of base64-encoded image files in PNG
            format. `finishReason` is SUCCESS unless `safety_check=true` and the
            image response was filtered. `seed` is the seed that was used when
            generating the image.
          in: header
          schema:
            type: string
            enum:
              - image/png
              - image/jpeg
              - application/json
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerations'
      responses:
        '200':
          description: OK
        '400':
          description: Invalid Request Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '429':
          description: Rate Limit Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
components:
  schemas:
    ImageGenerations:
      type: object
      properties:
        model:
          required: true
          type: string
          description: The name of the model to use.
          example: qwen-image
        prompt:
          required: true
          type: string
          description: >-
            The prompt to generate completions for.

            It can be a single string or an array of strings.

            It can also be an array of integers or an array of integer arrays,

            which allows to pass already tokenized prompt.

            If multiple prompts are specified, several choices with
            corresponding index will be returned in the output."
          example: The sky is
        width:
          type: integer
          description: Width
          default: 1024
          maximum: 2048
          minimum: 512
        height:
          type: integer
          description: Height
          default: 1024
          maximum: 2048
          minimum: 512
        num_inference_steps:
          type: integer
          description: Number of steps to use for the image generation process.
          minimum: 1
          maximum: 30
          default: 10
          example: 10
    ErrorMessage:
      type: object
      properties:
        error:
          type: string
          description: Error message text
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````