openapi: 3.0.3
servers:
  - url: https://prod.api.market/api/v1/magicapi/kandinsky
info:
  title: Text-to-HD Image Generation with Latent Diffusion and CLIP Integration
  description: Fast, Customizable, and ScalableAll-in-One Text-to-Image Solution
  version: 1.0.4
paths:
  /image/run:
    post:
      summary: Generate an image using the Kandinsky 2.1 model
      operationId: generateKandinskyImage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                input:
                  type: object
                  properties:
                    width:
                      type: integer
                      example: 512
                    height:
                      type: integer
                      example: 512
                    prompt:
                      type: string
                      example: red cat, 4k photo
                    scheduler:
                      type: string
                      example: p_sampler
                    batch_size:
                      type: integer
                      example: 1
                    prior_steps:
                      type: integer
                      example: 5
                    output_format:
                      type: string
                      example: webp
                    guidance_scale:
                      type: number
                      example: 4
                    output_quality:
                      type: integer
                      example: 80
                    prior_cf_scale:
                      type: number
                      example: 4
                    num_inference_steps:
                      type: integer
                      example: 100
              required:
                - input
      responses:
        "200":
          description: Successful image generation
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: The current status of the image generation task
                    example: IN_QUEUE
                  id:
                    type: string
                    description: The unique ID of the image generation request
                    example: 4f4b5af4-d5d0-413b-ba76-cee0f6d630b2-u1
        "400":
          description: Invalid input
        "401":
          description: Unauthorized
      security:
        - apiKeyAuth: []
    parameters:
      - &a1
        description: API.market API Key
        in: header
        name: x-api-market-key
        value: Please Login/Signup to get an API Key
        required: true
        schema:
          type: string
  /image/status/{taskId}:
    get:
      summary: Check image generation status
      operationId: getImageGenerationStatus
      parameters:
        - name: taskId
          in: path
          required: true
          schema:
            type: string
          description: The unique ID of the image generation task
          example: dbe7c2e6-382f-4dda-b3ed-9deca65e4cb6-e1
      responses:
        "200":
          description: Status of the image generation task
          content:
            application/json:
              schema:
                type: object
                properties:
                  delayTime:
                    type: integer
                    description: Delay time for task
                    example: 410
                  executionTime:
                    type: integer
                    description: Execution time of task in milliseconds
                    example: 5329
                  id:
                    type: string
                    description: The unique ID of the image generation task
                    example: a72ff596-9276-4a3b-825f-2d30898a7807-u1
                  output:
                    type: array
                    description: Array of output data
                    items:
                      type: string
                      example: data:None;base64,UklGRk59AABXRU..........zquYqRUYwyAAAAAA==
                  status:
                    type: string
                    description: The current status of the image generation task
                    example: COMPLETED
                  workerId:
                    type: string
                    description: The ID of the worker processing the task
                    example: 63a0wc0ornlzkv
        "401":
          description: Unauthorized
        "404":
          description: Task ID not found
      security:
        - apiKeyAuth: []
    parameters:
      - *a1
components:
  securitySchemes: {}
security: {}
tags:
  - name: tools
    description: Operations related to tools
  - name: visual-recognition
    description: Operations related to visual-recognition
  - name: artificial-intelligence
    description: Operations related to artificial-intelligence
  - name: text-to-image
    description: Operations related to text-to-image
