openapi: 3.0.0
paths:
  /:
    get:
      operationId: getApiMetadata
      summary: Get API metadata
      description: Retrieve the API version and the list of available routes.
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiMetadataResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - API
  /health:
    get:
      operationId: getHealth
      summary: Get API Health
      description: Retrieve the current health status of the API.
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - API
  /v1/models:
    get:
      operationId: getModels
      summary: Get models
      description: >-
        Retrieve a list of models that can be used for creating various types of
        artwork.
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Models
      security:
        - bearer: []
  /v1/aspect-ratios:
    get:
      operationId: getAspectRatios
      summary: Get aspect ratios
      description: >-
        Get a list of aspect ratios, including width and height details,
        available for creating different types of artwork.
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AspectRatioResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Aspect ratios
      security:
        - bearer: []
  /v1/styles:
    get:
      operationId: getStyles
      summary: Get styles
      description: >-
        Retrieve a list of styles available for creating various types of
        artwork, including details on img2img support and associated flags.
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/StyleResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Styles
      security:
        - bearer: []
  /v1/artworks:
    get:
      operationId: findAllArtworks
      summary: Find artworks
      description: >-
        Retrieve a list of artworks with details including ID, type, parameters,
        duration, results, status, and creation date.
      parameters:
        - name: offset
          required: false
          in: query
          schema:
            minimum: 0
            default: 0
            type: integer
        - name: limit
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 500
            default: 10
            type: integer
      responses:
        '200':
          description: List of artworks.
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/Txt2ImgArtworkResponse'
                    - $ref: '#/components/schemas/UpscalingArtworkResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Artworks
      security:
        - bearer: []
  /v1/artworks/{id}:
    get:
      operationId: findArtworkById
      summary: Find artwork by ID
      description: >-
        Retrieve an artworks with details including ID, type, parameters,
        duration, results, status, and creation date.
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Artwork response.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Txt2ImgArtworkResponse'
                  - $ref: '#/components/schemas/UpscalingArtworkResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Artwork not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Artworks
      security:
        - bearer: []
    delete:
      operationId: deleteArtworkById
      summary: Delete artwork by ID
      description: Delete an artwork using its ID.
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '204':
          description: ''
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Artworks
      security:
        - bearer: []
  /v1/artworks/selena:
    post:
      operationId: createTxt2ImgArtwork
      summary: Create txt2img artwork
      description: Generate artwork using text-to-image (txt2img) conversion.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTxt2ImgArtworkRequest'
      responses:
        '201':
          description: Response indicating that the artwork was successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Txt2ImgArtworkResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Artworks
      security:
        - bearer: []
  /v1/artworks/upscaling:
    post:
      operationId: createUpscalingArtwork
      summary: Create upscaling artwork
      description: Create high-resolution artwork by utilizing upscaling techniques.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUpscalingArtworkRequest'
      responses:
        '201':
          description: Response indicating that the artwork was successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpscalingArtworkResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Artworks
      security:
        - bearer: []
  /v1/artworks/photo-pilot:
    post:
      operationId: createPhotoPilotArtwork
      summary: Create Photo Pilot artwork
      description: Generate artwork using image-to-image conversion.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePhotoPilotArtworkRequest'
            examples:
              low-guidance-aspect-ratio:
                summary: Guidance is set to low and image size is set by aspect ratio
                description: >-
                  Width and height should not be set when aspect ratio is
                  present
                value:
                  prompt: >-
                    Change the cartoonish princess to a realistic woman with a
                    nice dress and realistic face and hair
                  imageUrl: >-
                    https://tengrai-generated.s3.amazonaws.com/fd840a87-0351-4974-8d19-c9b8f16282ff/0e59ed40-f6c9-48b5-938d-ab86a8c66171/tengrai_image_1767788215_5998735.webp
                  imageGuidance: 1
                  denoise: 5
                  creativity: 5
                  effort: 3
                  aspectRatio: '9:16'
              low-guidance-custom-size:
                summary: Guidance is set to low with custom image size
                description: >-
                  Aspect ratio is ommited image width and height is being used,
                  use it for custom sizes other then the ones defined via aspect
                  ratio
                value:
                  prompt: >-
                    Change the cartoonish princess to a realistic woman with a
                    nice dress and realistic face and hair
                  imageUrl: >-
                    https://tengrai-generated.s3.amazonaws.com/fd840a87-0351-4974-8d19-c9b8f16282ff/0e59ed40-f6c9-48b5-938d-ab86a8c66171/tengrai_image_1767788215_5998735.webp
                  imageGuidance: 1
                  denoise: 5
                  creativity: 5
                  effort: 3
                  width: '800'
                  height: '800'
              stronger-guidance-size-by-src-image:
                summary: Guidance medium or high
                description: >-
                  Aspect ratio is ommited image width and height is being used,
                  use it for custom sizes other then the ones defined via aspect
                  ratio
                value:
                  prompt: >-
                    Change the cartoonish princess to a realistic woman with a
                    nice dress and realistic face and hair
                  imageUrl: >-
                    https://tengrai-generated.s3.amazonaws.com/fd840a87-0351-4974-8d19-c9b8f16282ff/0e59ed40-f6c9-48b5-938d-ab86a8c66171/tengrai_image_1767788215_5998735.webp
                  imageGuidance: 2
                  denoise: 4
                  creativity: 4
                  effort: 2
      responses:
        '201':
          description: Response indicating that the artwork was successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhotoPilotArtworkResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Photo Pilot Artworks
      security:
        - bearer: []
  /v1/aspect-ratios/photo-pilot:
    get:
      operationId: getPhotoPilotAspectRatios
      summary: Get aspect ratios
      description: >-
        Get a list of aspect ratios, including width and height details,
        available for creating different types of artwork.
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AspectRatioListResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Photo pilot aspect ratios
      security:
        - bearer: []
  /v1/style-dna/generate-style-options:
    post:
      operationId: GenerationController_createStyleOptions
      summary: Generate style options
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StyleOptionsRequest'
      responses:
        '201':
          description: >-
            Response with a list of generated style options and cost of
            generation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StyleOptionsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Style DNA
      security:
        - bearer: []
  /v1/style-dna/generate-anchor:
    post:
      operationId: GenerationController_createAnchorImage
      summary: Generate anchor image
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnchorImageRequest'
      responses:
        '201':
          description: >-
            Response with a list of generated style options and cost of
            generation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnchorImageResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Style DNA
      security:
        - bearer: []
  /v1/style-dna/refine-prompt:
    post:
      operationId: GenerationController_refinePrompt
      summary: Refine existing prompt by the provided feedback
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefinePromptRequest'
      responses:
        '201':
          description: Response with the original and refiend prompt
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefinePromptResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Style DNA
      security:
        - bearer: []
  /v1/style-dna/generate:
    post:
      operationId: StyleDNAGenerateImage
      summary: Generate image asset
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequest'
            examples:
              generate-using-aspect-ratio:
                summary: generate by aspact ratio
                description: >-
                  Image is generated by the required fields visualPrompt,
                  anchorImage and description fields, image size via aspect
                  ratio
                value:
                  visualPrompt: White ship in the middle of the sea in a storm
                  anchorImageUrl: https://the-anchor-image-url.webp
                  description: Huge waves and lighting...
                  aspectRatio: '9:16'
              generate-using-custom-size:
                summary: generate by aspact ratio
                description: >-
                  Image is generated by the required fields visualPrompt,
                  anchorImage and description fields, image size via aspect
                  width and height
                value:
                  visualPrompt: White ship in the middle of the sea in a storm
                  anchorImageUrl: https://the-anchor-image-url.webp
                  description: Huge waves and lighting...
                  width: 860
                  height: 1440
      responses:
        '201':
          description: Generated image response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageEditResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Style DNA
      security:
        - bearer: []
  /v1/style-dna/edit:
    post:
      operationId: StyleDNAEditImage
      summary: Edit image asset
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageEditRequest'
            examples:
              edit-using-aspect-ratio:
                summary: generate by aspact ratio
                description: >-
                  Image is generated by the required fields visualPrompt,
                  anchorImage and description fields, image size via aspect
                  ratio
                value:
                  prompt: Remove the hat
                  imageUrl: https://image-url.webp
                  imageGuidance: 3
                  modification: 5
                  creativity: 5
                  effort: 1
                  aspectRatio: '9:16'
              edit-using-custom-size-and-format:
                summary: generate by aspact ratio
                description: >-
                  Image is generated by the required fields visualPrompt,
                  anchorImage and description fields, image size via aspect
                  width and height
                value:
                  prompt: Remove the hat
                  imageUrl: https://image-url.webp
                  imageGuidance: 3
                  modification: 3
                  creativity: 3
                  effort: 1
                  width: 860
                  height: 1440
                  imageFormat: webp
      responses:
        '201':
          description: Edited image data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnchorImageResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Style DNA
      security:
        - bearer: []
  /v1/textcraft:
    post:
      operationId: TextcraftController_createTextResponse
      summary: Call different llm models, sending text prompt and optionally image data
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Text2TextRequest'
            examples:
              basic-text-generation:
                summary: Basic text generation
                description: Simple prompt with model selection
                value:
                  prompt: Write a professional email about project status
                  model: agile-fast-2025-11-10
                  temperature: 0.7
                  maxTokens: 500
              image-url-analysis:
                summary: Text generation with image URL
                description: Generate text based on prompt and image from URL
                value:
                  prompt: Describe this image in detail
                  model: agile-fast-2025-11-10
                  imageUrl: https://example.com/image.jpg
                  temperature: 0.5
              image-base64-analysis:
                summary: Text generation with base64 image
                description: Generate text based on prompt and base64 encoded image
                value:
                  prompt: What objects are in this image?
                  model: agile-fast-2025-11-10
                  imageData: data:image/jpeg;base64,/9j/4AAQSkZJRg...
                  maxTokens: 300
      responses:
        '201':
          description: Response of the llm and cost of generation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Text2TextResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Textcraft
      security:
        - bearer: []
  /v1/textcraft/models:
    get:
      operationId: TextcraftController_getModels
      summary: List, optionally filter, available LLM models
      parameters:
        - name: name
          required: false
          in: query
          schema:
            type: string
        - name: released
          required: false
          in: query
          schema:
            properties:
              gte:
                type: string
                required: false
              lte:
                type: string
                required: false
            type: object
        - name: released[lte]
          required: false
          in: query
          description: Filter models released on or before this date (ISO 8601 format)
          schema:
            type: string
        - name: released[gte]
          required: false
          in: query
          description: Filter models released on or after this date (ISO 8601 format)
          schema:
            type: string
      responses:
        '200':
          description: List of available models.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ModelResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - Textcraft
      security:
        - bearer: []
info:
  title: Tengr.ai API
  description: >-
    Tengr.ai's Public API allows business users to manage and generate artworks.
    It supports listing, retrieving, creating, and deleting artworks, as well as
    advanced image generation capabilities through text-to-image (prompt-based)
    generation. Users can customize outputs with options like styles, aspect
    ratios, and models.
  version: 1.3.0
  contact:
    name: Tengr.ai Support Team
    url: support@tengrai.com
    email: support@tengrai.com
tags:
  - name: API
    description: >-
      The API Metadata endpoints provide the current API version, a list of
      available endpoints with their supported HTTP methods, and the status of
      the API health.
  - name: Artworks
    description: Offers endpoints to create, retrieve (by ID or all), and delete artworks.
  - name: Styles
    description: Provides an endpoint to list all available styles.
  - name: Aspect ratios
    description: Provides an endpoint to list all available aspect ratios.
  - name: Models
    description: >-
      Provides an endpoint to list all available models used for artwork
      creation.
servers:
  - url: https://api.tengr.ai
    description: Tengr.ai API
components:
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
  schemas:
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
        statusCode:
          type: number
        error:
          type: string
          description: Available only when the message includes additional error details.
      required:
        - message
        - statusCode
    ApiMetadataResponse:
      type: object
      properties:
        version:
          type: string
        routes:
          type: array
          items:
            type: object
            properties:
              method:
                type: string
                required: true
              path:
                type: string
                required: true
            required:
              - method
              - path
      required:
        - version
        - routes
    HealthResponse:
      type: object
      properties:
        status:
          type: string
      required:
        - status
    AspectRatioResponse:
      type: object
      properties:
        name:
          type: string
          enum:
            - '1:1'
            - '7:9'
            - '2:3'
            - '4:7'
            - '9:16'
            - '9:21'
            - '9:7'
            - '3:2'
            - '7:4'
            - '16:9'
            - '21:9'
        width:
          type: number
        height:
          type: number
      required:
        - name
        - width
        - height
    StyleResponse:
      type: object
      properties:
        name:
          type: string
          enum:
            - default
            - portraiture
            - landscape
            - photographer
            - analog
            - car
            - food
            - horror
            - stained-glass
            - impasto
            - abstract-ink
            - illustration
            - aquarelle
            - water-cute
            - sphericute
            - fairytale
            - machinart
            - isometric
            - logo
            - abstractpen
            - lineart
            - manga
            - infiny-weave
            - infiny-pattern
            - infiny-flow
        img2img:
          type: boolean
        flag:
          type: string
      required:
        - name
        - img2img
    CreateTxt2ImgArtworkRequest:
      type: object
      properties:
        model:
          default: tengrai-20231128-m-d.safetensors
          type: string
          enum:
            - tengrai-20231128-m-d.safetensors
            - tengrai-20240423-m-f.safetensors
        promptMode:
          default: seer
          type: string
          enum:
            - seer
            - servitor
        prompt:
          default: cat
          type: string
          description: Limited to 256 words; additional content will be truncated.
        negativePrompt:
          default: ''
          type: string
          description: Limited to 64 words; additional content will be truncated.
        style:
          default: default
          type: string
          enum:
            - default
            - portraiture
            - landscape
            - photographer
            - analog
            - car
            - food
            - horror
            - stained-glass
            - impasto
            - abstract-ink
            - illustration
            - aquarelle
            - water-cute
            - sphericute
            - fairytale
            - machinart
            - isometric
            - logo
            - abstractpen
            - lineart
            - manga
            - infiny-weave
            - infiny-pattern
            - infiny-flow
        creativity:
          default: 3
          type: integer
          minimum: 1
          maximum: 5
          multipleOf: 1
        details:
          default: 3
          type: integer
          minimum: 1
          maximum: 5
          multipleOf: 1
        aspectRatio:
          type: string
          enum:
            - '1:1'
            - '7:9'
            - '2:3'
            - '4:7'
            - '9:16'
            - '9:21'
            - '9:7'
            - '3:2'
            - '7:4'
            - '16:9'
            - '21:9'
          example: '1:1'
          description: >-
            Defaults to a 1:1 ratio (1024 × 1024) if width and height are not
            specified.
        width:
          type: integer
          minimum: 512
          maximum: 2048
          example: 1024
          description: >-
            Use aspectRatio instead of custom width and height for better
            quality.

            If defined, the total area (width × height) must not exceed
            1,478,656 pixels (e.g., 1216 × 1216).
        height:
          type: integer
          minimum: 512
          maximum: 2048
          example: 1024
          description: >-
            Use aspectRatio instead of custom width and height for better
            quality.

            If defined, the total area (width × height) must not exceed
            1,478,656 pixels (e.g., 1216 × 1216).
        nsfw:
          default: false
          type: boolean
        transparentBackground:
          default: false
          type: boolean
    Txt2ImgArtworkResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        artworkType:
          type: string
          enum:
            - selena
        parameters:
          type: object
          properties:
            model:
              default: tengrai-20231128-m-d.safetensors
              type: string
              enum:
                - tengrai-20231128-m-d.safetensors
                - tengrai-20240423-m-f.safetensors
              required: false
            promptMode:
              default: seer
              type: string
              enum:
                - seer
                - servitor
              required: false
            prompt:
              default: cat
              type: string
              description: Limited to 256 words; additional content will be truncated.
              required: false
            negativePrompt:
              default: ''
              type: string
              description: Limited to 64 words; additional content will be truncated.
              required: false
            style:
              default: default
              type: string
              enum:
                - default
                - portraiture
                - landscape
                - photographer
                - analog
                - car
                - food
                - horror
                - stained-glass
                - impasto
                - abstract-ink
                - illustration
                - aquarelle
                - water-cute
                - sphericute
                - fairytale
                - machinart
                - isometric
                - logo
                - abstractpen
                - lineart
                - manga
                - infiny-weave
                - infiny-pattern
                - infiny-flow
              required: false
            creativity:
              default: 3
              type: integer
              minimum: 1
              maximum: 5
              multipleOf: 1
              required: false
            details:
              default: 3
              type: integer
              minimum: 1
              maximum: 5
              multipleOf: 1
              required: false
            aspectRatio:
              type: string
              enum:
                - '1:1'
                - '7:9'
                - '2:3'
                - '4:7'
                - '9:16'
                - '9:21'
                - '9:7'
                - '3:2'
                - '7:4'
                - '16:9'
                - '21:9'
              example: '1:1'
              description: >-
                Defaults to a 1:1 ratio (1024 × 1024) if width and height are
                not specified.
              required: false
            width:
              type: integer
              minimum: 512
              maximum: 2048
              example: 1024
              description: >-
                Use aspectRatio instead of custom width and height for better
                quality.

                If defined, the total area (width × height) must not exceed
                1,478,656 pixels (e.g., 1216 × 1216).
              required: false
            height:
              type: integer
              minimum: 512
              maximum: 2048
              example: 1024
              description: >-
                Use aspectRatio instead of custom width and height for better
                quality.

                If defined, the total area (width × height) must not exceed
                1,478,656 pixels (e.g., 1216 × 1216).
              required: false
            nsfw:
              default: false
              type: boolean
              required: false
            transparentBackground:
              default: false
              type: boolean
              required: false
        duration:
          type: number
        results:
          type: array
          items:
            type: string
        status:
          type: string
          enum:
            - done
            - failed
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - artworkType
        - parameters
        - duration
        - results
        - status
        - createdAt
    CreateUpscalingArtworkRequest:
      type: object
      properties:
        imageUrl:
          type: string
          format: uri
          description: >-
            The URL of the image to be upscaled. The image's total area (width ×
            height) must not exceed 1,478,656 pixels (e.g., 1216 × 1216).
            Accepted image formats: JPEG, JPG, PNG, and WebP.
        scaleFactor:
          default: 2
          type: integer
          minimum: 2
          maximum: 8
      required:
        - imageUrl
    UpscalingArtworkResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        artworkType:
          type: string
          enum:
            - upscaling_v2
        parameters:
          type: object
          properties:
            imageUrl:
              type: string
              format: uri
              description: >-
                The URL of the image to be upscaled. The image's total area
                (width × height) must not exceed 1,478,656 pixels (e.g., 1216 ×
                1216). Accepted image formats: JPEG, JPG, PNG, and WebP.
              required: true
            scaleFactor:
              default: 2
              type: integer
              minimum: 2
              maximum: 8
              required: false
        duration:
          type: number
        results:
          type: array
          items:
            type: string
        status:
          type: string
          enum:
            - done
            - failed
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - artworkType
        - parameters
        - duration
        - results
        - status
        - createdAt
    CreatePhotoPilotArtworkRequest:
      type: object
      properties:
        prompt:
          default: cat
          type: string
          description: Limited to 256 words; additional content will be truncated.
        negativePrompt:
          default: ''
          type: string
          description: Limited to 64 words; additional content will be truncated.
        imageGuidance:
          type: number
          enum:
            - 1
            - 2
            - 3
          description: >-
            When image guidance is set to low size of image can be set as
            parameter otherwise the input image size is taken as reference
        modification:
          type: number
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
        creativity:
          type: number
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
        effort:
          type: number
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
        aspectRatio:
          type: string
          enum:
            - '1:1'
            - '2:3'
            - '3:4'
            - '4:3'
            - '9:16'
            - '3:2'
            - '16:9'
          description: >-
            Has effect only if image Guidance is set to low. Can not be used at
            the same time with width and height provide only aspect ratio or
            image size.
        highResolution:
          type: boolean
          description: Toggle high resolution size of supported aspect ratios
        width:
          type: number
          minimum: 512
          maximum: 2048
          example: 1024
          description: >-
            Use aspectRatio instead of custom width and height for better
            quality.

            If defined, the total area (width × height) must not exceed
            1,763,584 pixels.
        height:
          type: number
          minimum: 512
          maximum: 2048
          example: 1024
          description: >-
            Use aspectRatio instead of custom width and height for better
            quality.

            If defined, the total area (width × height) must not exceed
            1,763,584 pixels.
        imageUrl:
          type: string
      required:
        - imageGuidance
        - modification
        - creativity
        - effort
        - imageUrl
    PhotoPilotArtworkResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        artworkType:
          type: string
          enum:
            - photo_pilot
        parameters:
          type: object
          properties:
            prompt:
              default: cat
              type: string
              description: Limited to 256 words; additional content will be truncated.
              required: false
            negativePrompt:
              default: ''
              type: string
              description: Limited to 64 words; additional content will be truncated.
              required: false
            imageGuidance:
              type: number
              enum:
                - 1
                - 2
                - 3
              description: >-
                When image guidance is set to low size of image can be set as
                parameter otherwise the input image size is taken as reference
              required: true
            modification:
              type: number
              enum:
                - 1
                - 2
                - 3
                - 4
                - 5
              required: true
            creativity:
              type: number
              enum:
                - 1
                - 2
                - 3
                - 4
                - 5
              required: true
            effort:
              type: number
              enum:
                - 1
                - 2
                - 3
                - 4
                - 5
              required: true
            aspectRatio:
              type: string
              enum:
                - '1:1'
                - '2:3'
                - '3:4'
                - '4:3'
                - '9:16'
                - '3:2'
                - '16:9'
              description: >-
                Has effect only if image Guidance is set to low. Can not be used
                at the same time with width and height provide only aspect ratio
                or image size.
              required: false
            highResolution:
              type: boolean
              description: Toggle high resolution size of supported aspect ratios
              required: false
            width:
              type: number
              minimum: 512
              maximum: 2048
              example: 1024
              description: >-
                Use aspectRatio instead of custom width and height for better
                quality.

                If defined, the total area (width × height) must not exceed
                1,763,584 pixels.
              required: false
            height:
              type: number
              minimum: 512
              maximum: 2048
              example: 1024
              description: >-
                Use aspectRatio instead of custom width and height for better
                quality.

                If defined, the total area (width × height) must not exceed
                1,763,584 pixels.
              required: false
            imageUrl:
              type: string
              required: true
        duration:
          type: number
        results:
          type: array
          items:
            type: string
        status:
          type: string
          enum:
            - done
            - failed
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - artworkType
        - parameters
        - duration
        - results
        - status
        - createdAt
    AspectRatioListResponse:
      type: object
      properties:
        name:
          type: string
        aspectRatios:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                enum:
                  - '1:1'
                  - '2:3'
                  - '3:4'
                  - '4:3'
                  - '9:16'
                  - '3:2'
                  - '16:9'
                required: true
              width:
                type: number
                required: true
              height:
                type: number
                required: true
            required:
              - name
              - width
              - height
      required:
        - name
        - aspectRatios
    StyleOptionsRequest:
      type: object
      properties:
        description:
          type: string
        referenceImageUrl:
          type: string
        count:
          default: 3
          type: number
          minimum: 1
          maximum: 5
      required:
        - description
    StyleOptionsResponse:
      type: object
      properties:
        options:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                required: true
              description:
                type: string
                required: true
              visualPrompt:
                type: string
                required: true
            required:
              - name
              - description
              - visualPrompt
        creditsUsed:
          type: number
      required:
        - options
        - creditsUsed
    AnchorImageRequest:
      type: object
      properties:
        visualPrompt:
          type: string
        imageUrl:
          type: string
          description: Optional reference image
        aspectRatio:
          type: string
      required:
        - visualPrompt
        - aspectRatio
    AnchorImageResponse:
      type: object
      properties:
        imageUrl:
          type: string
        expiresAt:
          type: string
          format: date-time
        creditsUsed:
          type: number
      required:
        - imageUrl
        - expiresAt
        - creditsUsed
    RefinePromptRequest:
      type: object
      properties:
        prompt:
          type: string
        feedback:
          type: string
      required:
        - prompt
        - feedback
    RefinePromptResponse:
      type: object
      properties:
        originalPrompt:
          type: string
        refinedPrompt:
          type: string
        creditsUsed:
          type: number
      required:
        - originalPrompt
        - refinedPrompt
        - creditsUsed
    ImageGenerationRequest:
      type: object
      properties:
        visualPrompt:
          type: string
        anchorImageUrl:
          type: string
        description:
          type: string
        aspectRatio:
          type: string
          description: >-
            Has effect only if image Guidance is set to low. Can not be used at
            the same time with width and height provide only aspect ratio or
            image size.
        width:
          type: number
          minimum: 512
          maximum: 2048
          example: 1024
          description: >-
            Use aspectRatio instead of custom width and height for better
            quality.

            If defined, the total area (width × height) must not exceed
            1,763,584 pixels.
        height:
          type: number
          minimum: 512
          maximum: 2048
          example: 1024
          description: >-
            Use aspectRatio instead of custom width and height for better
            quality.

            If defined, the total area (width × height) must not exceed
            1,763,584 pixels.
        imageFormat:
          default: png
          type: string
          enum:
            - png
            - webp
          example: png
          description: 'Specify the format of the output image: png or webp'
      required:
        - visualPrompt
        - anchorImageUrl
        - description
    ImageEditResponse:
      type: object
      properties:
        imageUrl:
          type: string
        expiresAt:
          type: string
          format: date-time
        creditsUsed:
          type: number
      required:
        - imageUrl
        - expiresAt
        - creditsUsed
    ImageEditRequest:
      type: object
      properties:
        prompt:
          default: cat
          type: string
          description: Limited to 256 words; additional content will be truncated.
        negativePrompt:
          default: ''
          type: string
          description: Limited to 64 words; additional content will be truncated.
        imageGuidance:
          type: number
          enum:
            - 1
            - 2
            - 3
          description: >-
            When image guidance is set to low size of image can be set as
            parameter otherwise the input image size is taken as reference
        modification:
          type: number
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
        creativity:
          type: number
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
        effort:
          type: number
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
        aspectRatio:
          type: string
          enum:
            - '1:1'
            - '2:3'
            - '3:4'
            - '4:3'
            - '9:16'
            - '3:2'
            - '16:9'
          description: >-
            Has effect only if image Guidance is set to low. Can not be used at
            the same time with width and height provide only aspect ratio or
            image size.
        width:
          type: number
          minimum: 512
          maximum: 2048
          example: 1024
          description: >-
            Use aspectRatio instead of custom width and height for better
            quality.

            If defined, the total area (width × height) must not exceed
            1,763,584 pixels.
        height:
          type: number
          minimum: 512
          maximum: 2048
          example: 1024
          description: >-
            Use aspectRatio instead of custom width and height for better
            quality.

            If defined, the total area (width × height) must not exceed
            1,763,584 pixels.
        imageUrl:
          type: string
        imageFormat:
          default: png
          type: string
          enum:
            - png
            - webp
          example: png
          description: 'Specify the format of the output image: png or webp'
      required:
        - imageGuidance
        - modification
        - creativity
        - effort
        - imageUrl
    Text2TextRequest:
      type: object
      properties:
        prompt:
          type: string
        model:
          type: string
        temperature:
          type: number
        maxTokens:
          type: number
        imageUrl:
          type: string
        imageData:
          type: string
      required:
        - prompt
        - model
    Text2TextResponse:
      type: object
      properties:
        text:
          type: string
        tokens:
          type: number
        creditsUsed:
          type: number
      required:
        - text
        - creditsUsed
    ModelResponse:
      type: object
      properties:
        name:
          type: string
        releasedAt:
          type: string
          format: date-time
        imageInputSupported:
          type: boolean
      required:
        - name
        - releasedAt
        - imageInputSupported
