openapi: 3.0.0
paths:
  /images:
    post:
      operationId: images_create
      summary: Create a new image
      description: >-
        Creates a new image generation task from a text prompt.


        Supports both user integration and organization integration tokens.


        Required Parameters:

        - prompt: Text description of the desired image


        Optional Parameters:

        - width: Image width in pixels (480-2160, default: 1600)

        - height: Image height in pixels (480-2160, default: 1600)

        - quality: Generation quality level (1-6, default: 2)

        - creativity: Creative variation level (1-6, default: 2)

        - hasWatermark: Apply watermark (default: true)

        - baseModel: Base model identifier used for generation (max 255
        characters)

        - systemVersion: AI system version (2 or 3)

        - mode: Generation mode ("default" or "sigma")

        - organizationId: Organization UUID to deduct credits from (user must be
        a member)


        Credit Deduction:

        - If organizationId is provided, credits will be deducted from the
        organization account

        - If organizationId is not provided, credits will be deducted from the
        user account

        - User must be a member of the organization to use organization credits


        Monitor the generation status using the GET /images/{id} endpoint.
      parameters: []
      requestBody:
        required: true
        description: >-
          The image creation request parameters including prompt, dimensions,
          and quality settings
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageRequest'
      responses:
        '201':
          description: >-
            The image generation request was successfully created and queued for
            processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageDto'
        '400':
          description: |2-

                  Bad Request. Possible reasons:
                  - `width`: Must be between 480 and 2160 pixels.
                  - `height`: Must be between 480 and 2160 pixels.
                  - `quality`: Must be between 1 and 6.
                  - `creativity`: Must be between 1 and 6.
                  - `systemVersion`: Must be either 2 or 3.
                  - `mode`: Must be a valid value from the `ModeEnum`.
                  - `organizationId`: Must be a valid UUID format.
                  - Invalid or unavailable model referenced in prompt.
                  - Failed to analyze prompt or parameters.
                  - Organization does not exist.
                
        '401':
          description: >-
            Unauthorized. Authentication token is missing or invalid, or user is
            not a member of the specified organization
        '402':
          description: >-
            Payment Required. Insufficient credits to create the image (either
            user or organization credits depending on request)
        '403':
          description: Forbidden. User does not have permission to create images
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred during image
            creation
      tags:
        - images
      security:
        - bearer: []
    get:
      operationId: images_find
      summary: Find and filter images
      description: |-
        Retrieves a paginated list of images.

        Query Parameters:
        - page: Page number (default: 1)
        - limit: Items per page (1-50, default: 10)
        - sortBy: Field to sort by
        - sortOrder: "ASC" or "DESC"
        - userId: Filter by user ID
        - username: Filter by username
        - privacy: Filter by privacy level
        - systemVersion: Filter by system version
        - isHot: Filter by hot images
        - includeNsfw: Include NSFW content (default: false)
        - onlyFollowing: Show only images from followed users
        - modelIds: Filter by model IDs
        - status: Filter by status (see Status Values)

        Status Values:
        - new: Initial state, waiting to be processed
        - generating: Currently being generated
        - ready: Generation completed successfully
        - hidden: Image has been hidden from public view
        - failed: Generation failed
        - interrupted: Generation was interrupted
        - not_allowed: Generation was rejected

        Response Headers:
        - X-Total-Count: Total count of items
        - X-Current-Page: Current page of pagination
        - X-Per-Page: Results per page
        - X-Total-Pages: Total count of pages
      parameters:
        - name: page
          required: false
          in: query
          description: Page number
          schema:
            default: 1
            type: number
        - name: limit
          required: false
          in: query
          description: Number of items per page
          schema:
            default: 10
            type: number
        - name: sortBy
          required: false
          in: query
          description: Field to sort by
          schema:
            type: string
        - name: sortOrder
          required: false
          in: query
          description: Sort order (case insensitive)
          example: ASC
          schema:
            enum: &ref_0
              - ASC
              - DESC
              - asc
              - desc
            type: string
        - name: userId
          required: false
          in: query
          schema:
            type: string
        - name: username
          required: false
          in: query
          schema:
            type: string
        - name: privacy
          required: true
          in: query
          schema:
            enum: &ref_1
              - public
              - private
              - licensed
            type: string
        - name: status
          required: true
          in: query
          schema:
            enum: &ref_2
              - new
              - pending
              - training
              - finished
              - available
              - failed
            type: string
        - name: systemVersion
          required: false
          in: query
          schema:
            type: number
        - name: isHot
          required: false
          in: query
          schema:
            type: boolean
        - name: includeNsfw
          required: true
          in: query
          schema:
            type: boolean
        - name: onlyFollowing
          required: false
          in: query
          schema:
            type: boolean
        - name: modelIds
          required: false
          in: query
          schema:
            type: array
            items:
              type: string
        - description: Page number
          required: false
          name: page
          in: query
          schema:
            default: 1
            type: number
        - description: Number of items per page
          required: false
          name: limit
          in: query
          schema:
            default: 10
            type: number
        - description: Field to sort by
          required: false
          name: sortBy
          in: query
          schema:
            type: string
        - description: Sort order (case insensitive)
          required: false
          example: ASC
          name: sortOrder
          in: query
          schema:
            enum: *ref_0
            type: string
        - required: false
          name: userId
          in: query
          schema:
            type: string
        - required: false
          name: username
          in: query
          schema:
            type: string
        - name: privacy
          in: query
          required: true
          schema:
            enum: *ref_1
            type: string
        - name: status
          in: query
          required: true
          schema:
            enum: *ref_2
            type: string
        - required: false
          name: systemVersion
          in: query
          schema:
            type: number
        - required: false
          name: isHot
          in: query
          schema:
            type: boolean
        - name: includeNsfw
          in: query
          required: true
          schema:
            type: boolean
        - required: false
          name: onlyFollowing
          in: query
          schema:
            type: boolean
        - required: false
          name: modelIds
          in: query
          schema:
            type: array
      responses:
        '200':
          headers:
            X-Total-Count:
              description: Total count of items
              type: number
            X-Current-Page:
              description: Current page of pagination
              type: number
            X-Per-Page:
              description: Results per page
              type: number
            X-Total-Pages:
              description: Total count of pages
              type: number
          description: Successfully retrieved the list of images
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ImageDto'
        '400':
          description: |2-

                  Bad Request. Possible reasons:
                  - `page`: Must be a positive integer.
                  - `limit`: Must be a positive integer between 1 and 100.
                  - `sortBy`: Must be one of the allowed sort fields.
                  - `sortOrder`: Must be either 'ASC' or 'DESC'.
                  - Invalid filter parameters provided.
                  - Malformed query parameters.
                
        '401':
          description: Unauthorized. Authentication token is missing or invalid
        '403':
          description: Forbidden. User does not have permission to access these images
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while retrieving
            images
      tags: &ref_3
        - images
      security: &ref_4
        - bearer: []
  /images/{id}:
    get:
      operationId: images_get
      summary: Get detailed image information
      description: |-
        Retrieves information about a specific image by ID.

        Path Parameters:
        - id: UUID of the image
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the image
          schema:
            format: uuid
            type: string
      responses:
        '200':
          description: Successfully retrieved the image details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageDto'
        '400':
          description: |2-

                  Bad Request. Possible reasons:
                  - `id`: Must be a valid UUID format.
                  - Invalid image identifier provided.
                
        '401':
          description: Unauthorized. Authentication token is missing or invalid
        '403':
          description: Forbidden. User does not have permission to access this image
        '404':
          description: Not Found. The requested image does not exist
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while retrieving
            the image
      tags: *ref_3
      security: *ref_4
  /images/{id}/interruption:
    put:
      operationId: images_interrupt
      summary: Interrupt image generation
      description: |-
        Stops the ongoing generation process for a specific image.

        Path Parameters:
        - id: UUID of the image to interrupt

        The endpoint will:
        - Stop the generation process
        - Update image status to interrupted

        Note: Only works for images in generating status.
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the image to interrupt
          schema:
            format: uuid
            type: string
      responses:
        '204':
          description: The image generation was successfully interrupted.
        '400':
          description: |2-

                  Bad Request. Possible reasons:
                  - Image is not in a processing state
                  - Image does not exist
                  - Image belongs to another user
                
        '401':
          description: Unauthorized. The user is not authenticated.
        '404':
          description: Not Found. The requested image could not be found.
        '500':
          description: Internal Server Error. An unexpected error occurred.
      tags: &ref_5
        - images
      security: &ref_6
        - bearer: []
  /images/{id}/privacy:
    put:
      operationId: images_privacy_change
      summary: Update image privacy
      description: |-
        Changes the privacy settings of an image.

        Path Parameters:
        - id: UUID of the image

        Request Body:
        - privacy: New privacy level (public, private, organization)

        Note: Only works for images in ready status.
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the image to update
          schema:
            format: uuid
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImagePrivacyRequest'
      responses:
        '204':
          description: The image privacy was successfully updated.
        '400':
          description: |2-

                  Bad Request. Possible reasons:
                  - Image is not in READY state
                  - Image contains NSFW content
                  - Image uses private models
                  - Invalid privacy value
                
        '401':
          description: Unauthorized. The user is not authenticated.
        '404':
          description: Not Found. The requested image could not be found.
        '500':
          description: Internal Server Error. An unexpected error occurred.
      tags: *ref_5
      security: *ref_6
  /images/{id}/prompt-privacy:
    put:
      operationId: images_prompt_privacy_change
      summary: Update image prompt privacy
      description: |-
        Changes the prompt privacy settings of an image.

        Path Parameters:
        - id: UUID of the image

        Request Body:
        - hidden: Boolean indicating if the prompt should be hidden

        Note: Only works for images owned by the user.
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the image to update prompt privacy
          schema:
            format: uuid
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImagePromptPrivacyRequest'
      responses:
        '204':
          description: ''
        '400':
          description: |2-

                  Bad Request. Possible reasons:
                  - Invalid prompt privacy value
                
        '401':
          description: Unauthorized. The user is not authenticated.
        '404':
          description: Not Found. The requested image could not be found.
        '500':
          description: Internal Server Error. An unexpected error occurred.
      tags: *ref_5
      security: *ref_6
  /image-edits:
    post:
      operationId: image_edit_create
      summary: Create a new image edit
      description: >-
        Creates an image edit task that modifies an existing image using
        inpainting, outpainting, or skin editing.


        Required Parameters:

        - mode: "in" for inpainting (modify within image), "out" for outpainting
        (extend image), "skin" for skin editing, or "context" for context
        editing


        Optional Parameters:

        - originalImageCompletionIds: Array of UUIDs of original image
        completions

        - inputImageUrls: Array of source image URLs to edit

        - originalImageCompletionId: UUID of the original image completion to
        edit (alternative to inputImageUrls)

        - imageUrl: Source image URL to edit (alternative to
        originalImageCompletionIds)

        - prompt: Text description of the desired modifications

        - baseModel: Base model identifier for generation (max 255 characters)

        - mask: Base64 encoded image mask (required for inpainting)

        - width/height: Target dimensions for the edited image in pixels

        - imageCompletionsCount: Number of variations to generate (1-5, default:
        3)

        - organizationId: Organization UUID to deduct credits from (user must be
        a member)

        - settings: Additional generation settings object

        - webhookUrl: Optional URL to receive a POST notification when upscale
        is complete


        Credit Deduction:

        - If organizationId is provided, credits will be deducted from the
        organization account

        - If organizationId is not provided, credits will be deducted from the
        user account

        - User must be a member of the organization to use organization credits


        Response includes:

        - originalImageCompletions: Array of original image completions used as
        source

        - originalImageCompletionIds: Array of UUIDs of original image
        completions


        Monitor the edit status using the GET /image-edits/{id} endpoint.
      parameters: []
      requestBody:
        required: true
        description: The image edit request parameters
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageEditRequest'
      responses:
        '201':
          description: The image edit was successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageEditDto'
        '400':
          description: |2-

                  Bad Request. Possible reasons:
                  - Invalid input parameters
                  - Source image does not exist
                  - Source image is not in a valid state
                  - Invalid edit settings
                  - organizationId: Must be a valid UUID format
                  - Organization does not exist
                
        '401':
          description: >-
            Unauthorized. The user is not authenticated, or user is not a member
            of the specified organization.
        '402':
          description: >-
            Payment Required. Insufficient credits to create the image edit
            (either user or organization credits depending on request).
        '403':
          description: Forbidden. User does not have permission to create image edits.
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred during image
            edit creation.
      tags:
        - image-edit
      security:
        - bearer: []
    get:
      operationId: image_edit_find
      summary: Find image edits
      description: |-
        Retrieves a paginated list of image edits.

        Query Parameters:
        - page: Page number (default: 1)
        - limit: Items per page (default: 20)
        - sortBy: Field to sort by (createdAt, status)
        - sortOrder: "ASC" or "DESC"
        - status: Filter by status (see Status Values)

        Status Values:
        - new: Edit task created but not started
        - generating: Currently processing the edit
        - ready: Edit completed successfully
        - saved: Edit has been saved by user
        - failed: Edit failed to process
        - interrupted: Edit was stopped by user

        Response Headers:
        - X-Total-Count: Total count of items
        - X-Current-Page: Current page of pagination
        - X-Per-Page: Results per page
        - X-Total-Pages: Total count of pages
      parameters:
        - name: page
          required: false
          in: query
          description: Page number
          schema:
            default: 1
            type: number
        - name: limit
          required: false
          in: query
          description: Number of items per page
          schema:
            default: 10
            type: number
        - name: sortBy
          required: false
          in: query
          description: Field to sort by
          schema:
            type: string
        - name: sortOrder
          required: false
          in: query
          description: Sort order (case insensitive)
          example: ASC
          schema:
            enum: &ref_7
              - ASC
              - DESC
              - asc
              - desc
            type: string
        - name: status
          required: true
          in: query
          schema:
            enum: &ref_8
              - new
              - generating
              - ready
              - saved
              - failed
              - interrupted
            type: string
        - description: Page number
          required: false
          name: page
          in: query
          schema:
            default: 1
            type: number
        - description: Number of items per page
          required: false
          name: limit
          in: query
          schema:
            default: 10
            type: number
        - description: Field to sort by
          required: false
          name: sortBy
          in: query
          schema:
            type: string
        - description: Sort order (case insensitive)
          required: false
          example: ASC
          name: sortOrder
          in: query
          schema:
            enum: *ref_7
            type: string
        - name: status
          in: query
          required: true
          schema:
            enum: *ref_8
            type: string
      responses:
        '200':
          description: List of image edits successfully retrieved.
          headers:
            X-Total-Count:
              description: Total count of items
              type: number
            X-Current-Page:
              description: Current page of pagination
              type: number
            X-Per-Page:
              description: Results per page
              type: number
            X-Total-Pages:
              description: Total count of pages
              type: number
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ImageEditDto'
        '400':
          description: |2-

                  Bad Request. Possible reasons:
                  - Invalid pagination parameters
                  - Invalid sort parameters
                  - Invalid filter values
                
        '401':
          description: Unauthorized. The user is not authenticated.
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while retrieving
            the image edits.
      tags: &ref_9
        - image-edit
      security: &ref_10
        - bearer: []
  /image-edits/{id}:
    get:
      operationId: image_edit_get
      summary: Get an image edit
      description: |+
        Retrieves a specific image edit by ID.

        Path Parameters:
        - id: UUID of the image edit

      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the image edit to retrieve
          schema:
            type: string
      responses:
        '200':
          description: The image edit was successfully retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageEditDto'
        '400':
          description: |2-

                  Bad Request. Possible reasons:
                  - Invalid ID format
                  - Image edit does not exist
                
        '401':
          description: Unauthorized. The user is not authenticated.
        '403':
          description: Forbidden. User does not have permission to access this image edit.
        '404':
          description: Not Found. The requested image edit could not be found.
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while retrieving
            the image edit.
      tags: *ref_9
      security: *ref_10
  /image-edits/{imageCompletionId}/mask:
    get:
      operationId: image_edit_get_mask
      summary: Get mask for image completion
      description: >-
        Retrieves the mask associated with an image completion.


        Path Parameters:

        - imageCompletionId: UUID of the image completion


        Returns the mask data that was used for the image edit. This endpoint is
        useful for retrieving the original mask used in inpainting operations.
      parameters:
        - name: imageCompletionId
          required: true
          in: path
          description: ID of the image completion to retrieve the mask for
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageEditMaskDto'
        '400':
          description: ''
      tags: *ref_9
      security: *ref_10
  /models:
    get:
      operationId: models_find
      summary: Find models
      description: |-
        Retrieves a list of models based on search criteria.

        Query Parameters:
        - page: Page number
        - limit: Items per page
        - sortBy: Field to sort by
        - sortOrder: Sort direction (ASC, DESC)
        - search: General search term
        - name: Filter by model name
        - userId: Filter by user ID
        - username: Filter by username
        - class: Filter by model class
        - type: Filter by model type
        - description: Filter by model description
        - privacy: Filter by privacy level (public, private, licensed)
        - systemVersion: Filter by system version
        - isActive: Filter by active status
        - status: Filter by status (see Status Values)

        Status Values:
        - new: Initial state after creation
        - pending: Waiting for training to start
        - training: Currently being trained
        - finished: Training completed
        - available: Ready for public use
        - failed: Training failed

        Response Headers:
        - X-Total-Count: Total count of items
        - X-Current-Page: Current page of pagination
        - X-Per-Page: Results per page
        - X-Total-Pages: Total count of pages
      parameters:
        - name: page
          required: false
          in: query
          description: Page number
          schema:
            default: 1
            type: number
        - name: limit
          required: false
          in: query
          description: Number of items per page
          schema:
            default: 10
            type: number
        - name: sortBy
          required: false
          in: query
          description: Field to sort by
          schema:
            type: string
        - name: sortOrder
          required: false
          in: query
          description: Sort order (case insensitive)
          example: ASC
          schema:
            enum: &ref_11
              - ASC
              - DESC
              - asc
              - desc
            type: string
        - name: search
          required: false
          in: query
          schema:
            type: string
        - name: name
          required: false
          in: query
          schema:
            type: string
        - name: userId
          required: false
          in: query
          schema:
            type: string
        - name: username
          required: false
          in: query
          schema:
            type: string
        - name: class
          required: false
          in: query
          schema:
            type: string
        - name: type
          required: false
          in: query
          schema:
            type: string
        - name: description
          required: false
          in: query
          schema:
            type: string
        - name: privacy
          required: false
          in: query
          schema:
            enum: &ref_12
              - public
              - private
              - licensed
            type: string
        - name: systemVersion
          required: false
          in: query
          schema:
            type: number
        - name: status
          required: false
          in: query
          schema:
            enum: &ref_13
              - new
              - pending
              - training
              - finished
              - available
              - failed
            type: string
        - name: isActive
          required: false
          in: query
          schema:
            type: boolean
        - description: Page number
          required: false
          name: page
          in: query
          schema:
            default: 1
            type: number
        - description: Number of items per page
          required: false
          name: limit
          in: query
          schema:
            default: 10
            type: number
        - description: Field to sort by
          required: false
          name: sortBy
          in: query
          schema:
            type: string
        - description: Sort order (case insensitive)
          required: false
          example: ASC
          name: sortOrder
          in: query
          schema:
            enum: *ref_11
            type: string
        - required: false
          name: search
          in: query
          schema:
            type: string
        - required: false
          name: name
          in: query
          schema:
            type: string
        - required: false
          name: userId
          in: query
          schema:
            type: string
        - required: false
          name: username
          in: query
          schema:
            type: string
        - required: false
          name: class
          in: query
          schema:
            type: string
        - required: false
          name: type
          in: query
          schema:
            type: string
        - required: false
          name: description
          in: query
          schema:
            type: string
        - required: false
          name: privacy
          in: query
          schema:
            enum: *ref_12
            type: string
        - required: false
          name: systemVersion
          in: query
          schema:
            type: number
        - required: false
          name: status
          in: query
          schema:
            enum: *ref_13
            type: string
        - required: false
          name: isActive
          in: query
          schema:
            type: boolean
      responses:
        '200':
          headers:
            X-Total-Count:
              description: Total count of items
              type: number
            X-Current-Page:
              description: Current page of pagination
              type: number
            X-Per-Page:
              description: Results per page
              type: number
            X-Total-Pages:
              description: Total count of pages
              type: number
          description: List of models matching the search criteria.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ModelDto'
        '400':
          description: |2-

                  Bad Request. Possible reasons:
                  - Invalid query parameters
                  - Invalid pagination values
                  - Invalid sort parameters
                  - Malformed filters
                
        '401':
          description: Unauthorized. The user is not authenticated.
        '403':
          description: Forbidden. User does not have permission to access these models.
        '422':
          description: Unprocessable Entity. The search request contains invalid data.
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while retrieving
            models.
      tags: &ref_14
        - models
      security:
        - bearer: []
    post:
      operationId: models_create
      summary: Create a new model
      description: >-
        Creates a new AI model for image generation.


        Request Body Parameters:

        - name: Model identifier (alphanumeric, underscores, dots)

        - privacy: Access level (public, private, organization)

        - type: Model type classification

        - class: Model category

        - description: Optional description of the model

        - website: Optional website URL

        - settings: Optional array of settings (NO_ADULT_CONTENT, NO_VIOLENCE,
        etc)

        - trainingDataUrls: Array of image URLs for training (1-50 URLs
        required)

        - webhookUrl: Optional URL to receive a POST notification when training
        is complete

        - trainingMode: Optional training mode (e.g., "default", "sigma")

        - organizationId: Organization UUID to deduct credits from (user must be
        a member)


        Credit Deduction:

        - If organizationId is provided, credits will be deducted from the
        organization account

        - If organizationId is not provided, credits will be deducted from the
        user account

        - User must be a member of the organization to use organization credits


        Note: Training process starts automatically after creation.
      parameters: []
      requestBody:
        required: true
        description: The model creation request payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelCreateRequest'
      responses:
        '200':
          description: The model was successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelDto'
        '400':
          description: |2-

                  Bad Request. Possible reasons:
                  - `name`: Must contain only alphanumeric characters, underscores, and dots.
                  - `name`: Must be shorter than or equal to 255 characters.
                  - `privacy`: Must be a valid value from the `PrivacyEnum`.
                  - `type`: Must contain only allowed characters (alphanumeric, commas, hyphens, etc.).
                  - `class`: Must be a valid value from the `ClassEnum`.
                  - `trainingDataUrls`: Must be an array of valid URLs (max 50).
                  - `webhookUrl`: Must be a valid URL.
                  - `trainingMode`: Must be a valid value from the `TrainingModeEnum`.
                  - `organizationId`: Must be a valid UUID format.
                  - Missing or invalid `class` field (mandatory).
                  - Failed to analyze model type due to invalid training data URLs.
                  - Organization does not exist.
                
        '401':
          description: >-
            Unauthorized. The user is not authenticated, or user is not a member
            of the specified organization.
        '402':
          description: >-
            Payment Required. Insufficient credits to create the model (either
            user or organization credits depending on request).
        '404':
          description: Not Found. The requested resource could not be found.
        '500':
          description: Internal Server Error. An unexpected error occurred.
      tags:
        - models
      security:
        - bearer: []
  /models/{id}:
    get:
      operationId: models_get
      summary: Get a model
      description: |
        Retrieves detailed information about a specific model.

        Path Parameters:
        - id: UUID of the model to retrieve
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the model to retrieve
          schema:
            format: uuid
            type: string
      responses:
        '200':
          description: The requested model details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelDto'
        '400':
          description: |2-

                  Bad Request. Possible reasons:
                  - Invalid ID format
                  - Model does not exist
                
        '401':
          description: Unauthorized. The user is not authenticated.
        '403':
          description: Forbidden. User does not have permission to view this model.
        '404':
          description: Not Found. The requested model could not be found.
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while retrieving
            the model.
      tags: *ref_14
      security:
        - bearer: []
    patch:
      operationId: model_update
      summary: Update model information
      description: |-
        Updates the information of an existing model.

        Path Parameters:
        - id: UUID of the model

        Request Body:
        - privacy: New privacy setting (public, private, licensed)
        - type: New model type
        - description: New model description
        - website: New website URL
        - settings: New model settings
      parameters:
        - name: id
          required: true
          in: path
          description: Model ID
          schema:
            format: uuid
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelUpdateRequest'
      responses:
        '200':
          description: The model was successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelDto'
        '400':
          description: Invalid request parameters or model ID format
        '401':
          description: Unauthorized. The user is not authenticated
        '403':
          description: Forbidden. User does not have permission to update this model
        '404':
          description: Not Found. The model to update could not be found
      tags:
        - models
      security:
        - bearer: []
    delete:
      operationId: models_delete
      summary: Delete a model
      description: |-
        Permanently deletes a model.

        Path Parameters:
        - id: UUID of the model to delete
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the model to delete
          schema:
            format: uuid
            type: string
      responses:
        '204':
          description: The model was successfully deleted.
        '400':
          description: |2-

                  Bad Request. Possible reasons:
                  - Invalid ID format
                  - Model does not exist
                  - Model is in use by active generations
                
        '401':
          description: Unauthorized. The user is not authenticated.
        '403':
          description: Forbidden. User does not have permission to delete this model.
        '404':
          description: Not Found. The requested model could not be found.
        '409':
          description: >-
            Conflict. The model cannot be deleted because it is being used by
            other resources.
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while deleting
            the model.
      tags:
        - models
      security:
        - bearer: []
  /models/{id}/thumbnail:
    put:
      operationId: model_thumbnail
      summary: Update model thumbnail
      description: |-
        Updates the thumbnail of a model.

        Path Parameters:
        - id: UUID of the model

        Request Body:
        - imageCompletionId: UUID of the image to use as thumbnail
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the model to update
          schema:
            format: uuid
            type: string
      requestBody:
        required: true
        description: The thumbnail update request containing the image completion ID
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelThumbnailRequest'
      responses:
        '200':
          description: The model thumbnail was successfully updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelDto'
        '400':
          description: |2-

                  Bad Request. Possible reasons:
                  - Invalid model ID format
                  - Invalid image completion ID
                  - Image completion not found
                  - Image completion not ready
                  - Image completion belongs to different user
                
        '401':
          description: Unauthorized. The user is not authenticated.
        '403':
          description: Forbidden. User does not have permission to update this model.
        '404':
          description: Not Found. The model to update could not be found.
        '409':
          description: |2-

                  Conflict. Possible reasons:
                  - Model is currently being processed
                  - Model is in an invalid state for updates
                
        '422':
          description: Unprocessable Entity. The request payload contains invalid data.
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while updating
            the thumbnail.
      tags:
        - models
      security:
        - bearer: []
  /upscale:
    post:
      operationId: upscale_create
      summary: Generate a new upscale
      description: >-
        Creates a new upscale request for an existing image.


        Request Body:

        - prompt: Optional text prompt to guide the upscale

        - mode: Upscale mode (any string, max 32 characters; default: default)

        - imageId: UUID of the source image (required if imageUrl not provided)

        - imageUrl: Direct URL to the image (required if imageId not provided)

        - size: Optional size of the upscale

        - strength: Upscale strength factor from 1 to 5 (default: 1)

        - organizationId: Organization UUID to deduct credits from (user must be
        a member)

        - webhookUrl: Optional URL to receive a POST notification when upscale
        is complete


        Credit Deduction:

        - If organizationId is provided, credits will be deducted from the
        organization account

        - If organizationId is not provided, credits will be deducted from the
        user account

        - User must be a member of the organization to use organization credits
      parameters: []
      requestBody:
        required: true
        description: The upscale request parameters
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpscaleRequest'
      responses:
        '201':
          description: The upscale request was successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpscaleDto'
        '400':
          description: |2-

                  Bad Request. Possible reasons:
                  - Invalid image ID
                  - Invalid upscale parameters
                  - Source image not found
                  - Source image not in ready state
                  - organizationId: Must be a valid UUID format
                  - Organization does not exist
                  - User is not a member of the organization
                  - Size must be at least 2
                  - Size must be at most 12
                  - mode: Must be a string (max 32 characters).
                
        '401':
          description: >-
            Unauthorized. The user is not authenticated, or user is not a member
            of the specified organization.
        '402':
          description: >-
            Payment Required. Insufficient credit balance (either user or
            organization credits depending on request).
        '403':
          description: Forbidden. User does not have permission to upscale this image.
        '422':
          description: Unprocessable Entity. The request payload contains invalid data.
        '500':
          description: Internal Server Error. An unexpected error occurred.
      tags:
        - upscale
      security:
        - bearer: []
    get:
      operationId: upscale_find
      summary: Find upscales
      description: |-
        Retrieves a paginated list of upscales.

        Query Parameters:
        - page: Page number (default: 1)
        - limit: Items per page (1-50, default: 10)
        - sortBy: Field to sort by
        - sortOrder: "ASC" or "DESC"
        - userId: Filter by user ID
        - username: Filter by username
        - imageId: Filter by source image ID
        - onlyFollowing: Show only upscales from followed users
        - status: Filter by status (see Status Values)

        Status Values:
        - new: Initial state, waiting to be processed
        - generating: Currently being upscaled
        - ready: Upscale completed successfully
        - failed: Upscale failed

        Response Headers:
        - X-Total-Count: Total count of items
        - X-Current-Page: Current page of pagination
        - X-Per-Page: Results per page
        - X-Total-Pages: Total count of pages
      parameters:
        - name: page
          required: false
          in: query
          description: Page number
          schema:
            default: 1
            type: number
        - name: limit
          required: false
          in: query
          description: Number of items per page
          schema:
            default: 10
            type: number
        - name: sortBy
          required: false
          in: query
          description: Field to sort by
          schema:
            type: string
        - name: sortOrder
          required: false
          in: query
          description: Sort order (case insensitive)
          example: ASC
          schema:
            enum: &ref_15
              - ASC
              - DESC
              - asc
              - desc
            type: string
        - name: userId
          required: false
          in: query
          schema:
            type: string
        - name: username
          required: false
          in: query
          schema:
            type: string
        - name: imageId
          required: false
          in: query
          schema:
            type: string
        - name: status
          required: false
          in: query
          schema:
            enum: &ref_16
              - new
              - generating
              - ready
              - failed
            type: string
        - name: onlyFollowing
          required: false
          in: query
          schema:
            type: boolean
        - description: Page number
          required: false
          name: page
          in: query
          schema:
            default: 1
            type: number
        - description: Number of items per page
          required: false
          name: limit
          in: query
          schema:
            default: 10
            type: number
        - description: Field to sort by
          required: false
          name: sortBy
          in: query
          schema:
            type: string
        - description: Sort order (case insensitive)
          required: false
          example: ASC
          name: sortOrder
          in: query
          schema:
            enum: *ref_15
            type: string
        - required: false
          name: userId
          in: query
          schema:
            type: string
        - required: false
          name: username
          in: query
          schema:
            type: string
        - required: false
          name: imageId
          in: query
          schema:
            type: string
        - required: false
          name: status
          in: query
          schema:
            enum: *ref_16
            type: string
        - required: false
          name: onlyFollowing
          in: query
          schema:
            type: boolean
      responses:
        '200':
          headers:
            X-Total-Count:
              description: Total count of items
              type: number
            X-Current-Page:
              description: Current page of pagination
              type: number
            X-Per-Page:
              description: Results per page
              type: number
            X-Total-Pages:
              description: Total count of pages
              type: number
          description: List of upscales matching the search criteria.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UpscaleDto'
        '400':
          description: Bad Request. The request parameters are invalid.
        '401':
          description: Unauthorized. The user is not authenticated.
        '403':
          description: Forbidden. User does not have permission to access these upscales.
        '422':
          description: Unprocessable Entity. Invalid search parameters.
        '500':
          description: Internal Server Error. An unexpected error occurred.
      tags: &ref_17
        - upscale
      security: &ref_18
        - bearer: []
  /upscale/{id}:
    get:
      operationId: upscale_get
      summary: Get upscale details
      description: |-
        Retrieves details of a specific upscale.

        Path Parameters:
        - id: UUID of the upscale to retrieve
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the upscale to retrieve
          schema:
            format: uuid
            type: string
      responses:
        '200':
          description: The requested upscale details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpscaleDto'
        '400':
          description: Bad Request. The request parameters are invalid.
        '401':
          description: Unauthorized. The user is not authenticated.
        '403':
          description: Forbidden. User does not have permission to access this upscale.
        '404':
          description: Not Found. The requested upscale could not be found.
        '500':
          description: Internal Server Error. An unexpected error occurred.
      tags: *ref_17
      security: *ref_18
    delete:
      operationId: upscale_delete
      summary: Delete an upscale
      description: |-
        Deletes an existing upscale request.

        Path Parameters:
        - id: UUID of the upscale to delete
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the upscale to delete
          schema:
            format: uuid
            type: string
      responses:
        '204':
          description: The upscale was successfully deleted.
        '400':
          description: Bad Request. The request parameters are invalid.
        '401':
          description: Unauthorized. The user is not authenticated.
        '403':
          description: Forbidden. User does not have permission to delete this upscale.
        '404':
          description: Not Found. The upscale to delete could not be found.
        '422':
          description: Unprocessable Entity. Invalid request parameters.
        '500':
          description: Internal Server Error. An unexpected error occurred.
      tags:
        - upscale
      security:
        - bearer: []
  /user-images:
    post:
      operationId: user_image_create
      summary: Create a new user image or video
      description: >-
        Creates a new image or video entry and generates an upload URL.


        Supported formats:

        - Images: jpg, jpeg, png, gif, webp

        - Videos: mp4, webm, mov, avi


        The response includes an 'uploadUrl' property which is a pre-signed S3
        URL that can be used to upload the file.


        To upload the file:

        1. Make a PUT request to the uploadUrl with the file as the request body

        2. Set the Content-Type header to match the file type (e.g.,
        'image/jpeg', 'image/png', 'video/mp4', 'video/webm')

        3. No authentication is required for this PUT request as the URL is
        pre-signed


        Example uploading an image using curl:

        ```

        curl -X PUT -H "Content-Type: image/jpeg" --data-binary
        "@/path/to/image.jpg" "https://pre-signed-url-from-response"

        ```


        Example uploading a video using curl:

        ```

        curl -X PUT -H "Content-Type: video/mp4" --data-binary
        "@/path/to/video.mp4" "https://pre-signed-url-from-response"

        ```


        Example using JavaScript fetch:

        ```javascript

        const response = await fetch(uploadUrl, {
          method: 'PUT',
          headers: {
            'Content-Type': 'video/mp4' // or 'image/jpeg', etc.
          },
          body: file // File or Blob object
        });

        ```


        After successful upload, the file will be accessible via the 'imageUrl'
        property in the response.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserImageRequest'
      responses:
        '200':
          description: The user image was successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserImageDto'
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized. The user is not authenticated
        '402':
          description: Payment Required. Insufficient credit balance.
        '403':
          description: Forbidden. User does not have permission to create images
        '404':
          description: Not Found. The requested resource could not be found.
        '422':
          description: Unprocessable Entity. The request payload contains invalid data.
        '429':
          description: Too Many Requests. Please try again later.
        '500':
          description: Internal Server Error. An unexpected error occurred.
      tags:
        - user-images
      security:
        - bearer: []
    get:
      operationId: user_image_list
      summary: List user images and videos
      description: >-
        Returns a list of images and videos uploaded by the authenticated user.


        The list is sorted by creation date in descending order, with a maximum
        of 100 items per page.
      parameters: []
      responses:
        '200':
          description: List of user images and videos retrieved successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserImageDto'
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized. The user is not authenticated
        '403':
          description: Forbidden. User does not have permission to list images
        '422':
          description: Unprocessable Entity. Invalid request parameters
        '429':
          description: Too Many Requests. Please try again later
        '500':
          description: Internal Server Error. An unexpected error occurred
      tags: &ref_19
        - user-images
      security: &ref_20
        - bearer: []
  /user-images/{id}:
    get:
      operationId: user_image_get
      summary: Get a user image or video
      description: |-
        Returns details of a specific image or video from your library.

        Path Parameters:
        - id: UUID of the file
      parameters:
        - name: id
          required: true
          in: path
          description: File ID
          schema:
            format: uuid
            type: string
      responses:
        '200':
          description: The user image or video was successfully retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserImageDto'
        '400':
          description: Invalid file ID format
        '401':
          description: Unauthorized. The user is not authenticated
        '403':
          description: Forbidden. User does not have permission to access this file
        '404':
          description: Not Found. The requested file could not be found
        '422':
          description: Unprocessable Entity. Invalid request parameters
        '429':
          description: Too Many Requests. Please try again later
        '500':
          description: Internal Server Error. An unexpected error occurred
      tags: *ref_19
      security: *ref_20
    delete:
      operationId: user_image_delete
      summary: Delete a user image
      description: |-
        Deletes a user image from your library.

        Path Parameters:
        - id: UUID of the image to delete
      parameters:
        - name: id
          required: true
          in: path
          description: Image ID
          schema:
            format: uuid
            type: string
      responses:
        '204':
          description: The image was successfully deleted
        '400':
          description: Invalid image ID format
        '401':
          description: Unauthorized. The user is not authenticated
        '403':
          description: Forbidden. User does not have permission to delete this image
        '404':
          description: Not Found. The image to delete could not be found
        '422':
          description: Unprocessable Entity. Invalid request parameters
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while deleting
            the image
      tags:
        - user-images
      security:
        - bearer: []
  /user-assets:
    post:
      operationId: user_asset_create
      summary: Create a new user asset (image, video, or audio)
      description: >-
        Creates a new asset entry and generates an upload URL.


        Supported formats:

        - Images: jpg, jpeg, png, gif, webp

        - Videos: mp4, webm, mov, avi

        - Audio: mp3, wav, ogg, m4a, aac, flac


        The response includes an 'uploadUrl' property which is a pre-signed S3
        URL that can be used to upload the file.


        To upload the file:

        1. Make a PUT request to the uploadUrl with the file as the request body

        2. Set the Content-Type header to match the file type (e.g.,
        'image/jpeg', 'video/mp4', 'audio/mpeg')

        3. No authentication is required for this PUT request as the URL is
        pre-signed


        Example uploading an image using curl:

        ```

        curl -X PUT -H "Content-Type: image/jpeg" --data-binary
        "@/path/to/image.jpg" "https://pre-signed-url-from-response"

        ```


        Example uploading a video using curl:

        ```

        curl -X PUT -H "Content-Type: video/mp4" --data-binary
        "@/path/to/video.mp4" "https://pre-signed-url-from-response"

        ```


        Example uploading an audio file using curl:

        ```

        curl -X PUT -H "Content-Type: audio/mpeg" --data-binary
        "@/path/to/audio.mp3" "https://pre-signed-url-from-response"

        ```


        Example using JavaScript fetch:

        ```javascript

        const response = await fetch(uploadUrl, {
          method: 'PUT',
          headers: {
            'Content-Type': 'audio/mpeg' // or 'image/jpeg', 'video/mp4', etc.
          },
          body: file // File or Blob object
        });

        ```


        After successful upload, the file will be accessible via the 'imageUrl'
        property in the response.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserAssetRequest'
      responses:
        '200':
          description: The user asset was successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserAssetDto'
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized. The user is not authenticated
        '402':
          description: Payment Required. Insufficient credit balance.
        '403':
          description: Forbidden. User does not have permission to create assets
        '404':
          description: Not Found. The requested resource could not be found.
        '422':
          description: Unprocessable Entity. The request payload contains invalid data.
        '429':
          description: Too Many Requests. Please try again later.
        '500':
          description: Internal Server Error. An unexpected error occurred.
      tags:
        - user-assets
      security:
        - bearer: []
    get:
      operationId: user_asset_list
      summary: List user assets (images and videos)
      description: >-
        Returns a list of images and videos uploaded by the authenticated user.


        The list is sorted by creation date in descending order, with a maximum
        of 100 items per page.
      parameters: []
      responses:
        '200':
          description: List of user assets (images and videos) retrieved successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserAssetDto'
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized. The user is not authenticated
        '403':
          description: Forbidden. User does not have permission to list assets
        '422':
          description: Unprocessable Entity. Invalid request parameters
        '429':
          description: Too Many Requests. Please try again later
        '500':
          description: Internal Server Error. An unexpected error occurred
      tags: &ref_21
        - user-assets
      security: &ref_22
        - bearer: []
  /user-assets/{id}:
    get:
      operationId: user_asset_get
      summary: Get a user asset (image or video)
      description: |-
        Returns details of a specific image or video from your library.

        Path Parameters:
        - id: UUID of the file
      parameters:
        - name: id
          required: true
          in: path
          description: File ID
          schema:
            format: uuid
            type: string
      responses:
        '200':
          description: The user asset (image or video) was successfully retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserAssetDto'
        '400':
          description: Invalid file ID format
        '401':
          description: Unauthorized. The user is not authenticated
        '403':
          description: Forbidden. User does not have permission to access this file
        '404':
          description: Not Found. The requested file could not be found
        '422':
          description: Unprocessable Entity. Invalid request parameters
        '429':
          description: Too Many Requests. Please try again later
        '500':
          description: Internal Server Error. An unexpected error occurred
      tags: *ref_21
      security: *ref_22
    patch:
      operationId: public_user_asset_update
      summary: Update a user asset
      description: >-
        Updates editable fields of a user asset from your library. Currently
        supports caption updates.
      parameters:
        - name: id
          required: true
          in: path
          description: Asset ID
          schema:
            format: uuid
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserAssetUpdateRequest'
      responses:
        '200':
          description: The asset was successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserAssetDto'
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized. The user is not authenticated
        '403':
          description: Forbidden. User does not have permission to update this asset
        '404':
          description: Not Found. The asset to update could not be found
        '422':
          description: Unprocessable Entity. Invalid request parameters
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while updating
            the asset
      tags:
        - user-assets
      security:
        - bearer: []
    delete:
      operationId: user_asset_delete
      summary: Delete a user asset
      description: |-
        Deletes a user asset from your library.

        Path Parameters:
        - id: UUID of the asset to delete
      parameters:
        - name: id
          required: true
          in: path
          description: Asset ID
          schema:
            format: uuid
            type: string
      responses:
        '204':
          description: The asset was successfully deleted
        '400':
          description: Invalid asset ID format
        '401':
          description: Unauthorized. The user is not authenticated
        '403':
          description: Forbidden. User does not have permission to delete this asset
        '404':
          description: Not Found. The asset to delete could not be found
        '422':
          description: Unprocessable Entity. Invalid request parameters
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while deleting
            the asset
      tags:
        - user-assets
      security:
        - bearer: []
  /videos:
    get:
      operationId: public_video_list
      summary: List videos (public API)
      description: |-
        Retrieves a paginated list of videos.

        Optional Query Parameters:
        - page: Page number (default: 1)
        - limit: Items per page (1-50, default: 10)
        - sortBy: Field to sort by
        - sortOrder: "ASC" or "DESC"
        - userId: Filter by user ID
        - username: Filter by username
        - status: Filter by video status
        - width: Filter by video width
        - height: Filter by video height
        - resolution: Filter by video resolution
        - prompt: Filter by prompt text
        - hidePrompt: Filter by hidden prompts

        Note: Only videos based on public, ready, non-NSFW images are returned.
      parameters:
        - name: page
          required: false
          in: query
          description: Page number
          schema:
            default: 1
            type: number
        - name: limit
          required: false
          in: query
          description: Number of items per page
          schema:
            default: 10
            type: number
        - name: sortBy
          required: false
          in: query
          description: Field to sort by
          schema:
            type: string
        - name: sortOrder
          required: false
          in: query
          description: Sort order (case insensitive)
          example: ASC
          schema:
            enum: &ref_23
              - ASC
              - DESC
              - asc
              - desc
            type: string
        - name: userId
          required: false
          in: query
          description: Filter by user ID
          schema:
            type: string
        - name: username
          required: false
          in: query
          description: Filter by username
          schema:
            type: string
        - name: organizationId
          required: false
          in: query
          description: Filter by organization ID
          schema:
            type: string
        - name: originalImageCompletionId
          required: false
          in: query
          description: Filter by original image completion ID
          schema:
            type: string
        - name: prompt
          required: false
          in: query
          description: Filter by prompt text
          schema:
            type: string
        - name: status
          required: false
          in: query
          description: Filter by video status
          schema:
            enum: &ref_24
              - new
              - generating
              - ready
              - saved
              - failed
              - interrupted
            type: string
        - name: width
          required: false
          in: query
          description: Filter by width
          schema:
            type: number
        - name: height
          required: false
          in: query
          description: Filter by height
          schema:
            type: number
        - name: resolution
          required: false
          in: query
          description: Filter by resolution
          schema:
            type: number
        - name: isNsfw
          required: false
          in: query
          description: Filter by NSFW content
          schema:
            type: boolean
        - name: isHot
          required: false
          in: query
          description: Filter by hot content
          schema:
            type: boolean
        - name: isUnsafe
          required: false
          in: query
          description: Filter by unsafe content
          schema:
            type: boolean
        - name: hidePrompt
          required: false
          in: query
          description: Filter by hidden prompts
          schema:
            type: boolean
        - name: modelIds
          required: false
          in: query
          description: Array of model IDs to filter by
          schema:
            type: array
            items:
              type: string
        - description: Page number
          required: false
          name: page
          in: query
          schema:
            default: 1
            type: number
        - description: Number of items per page
          required: false
          name: limit
          in: query
          schema:
            default: 10
            type: number
        - description: Field to sort by
          required: false
          name: sortBy
          in: query
          schema:
            type: string
        - description: Sort order (case insensitive)
          required: false
          example: ASC
          name: sortOrder
          in: query
          schema:
            enum: *ref_23
            type: string
        - description: Filter by user ID
          required: false
          name: userId
          in: query
          schema:
            type: string
        - description: Filter by username
          required: false
          name: username
          in: query
          schema:
            type: string
        - description: Filter by organization ID
          required: false
          name: organizationId
          in: query
          schema:
            type: string
        - description: Filter by original image completion ID
          required: false
          name: originalImageCompletionId
          in: query
          schema:
            type: string
        - description: Filter by prompt text
          required: false
          name: prompt
          in: query
          schema:
            type: string
        - description: Filter by video status
          required: false
          name: status
          in: query
          schema:
            enum: *ref_24
            type: string
        - description: Filter by width
          required: false
          name: width
          in: query
          schema:
            type: number
        - description: Filter by height
          required: false
          name: height
          in: query
          schema:
            type: number
        - description: Filter by resolution
          required: false
          name: resolution
          in: query
          schema:
            type: number
        - description: Filter by NSFW content
          required: false
          name: isNsfw
          in: query
          schema:
            type: boolean
        - description: Filter by hot content
          required: false
          name: isHot
          in: query
          schema:
            type: boolean
        - description: Filter by unsafe content
          required: false
          name: isUnsafe
          in: query
          schema:
            type: boolean
        - description: Filter by hidden prompts
          required: false
          name: hidePrompt
          in: query
          schema:
            type: boolean
        - description: Array of model IDs to filter by
          required: false
          name: modelIds
          in: query
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: Paginated list of videos
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VideoDto'
        '400':
          description: |-
            Bad Request. Possible reasons:

                  - Pagination parameters (page, limit) must be positive integers between 1 and 50.
                  - Sort parameters (sortBy, sortOrder) must be valid values.
                  - Filter parameters must be valid values.
                  - userId: Must be a valid UUID.
                  - username: Must be a valid username.
                  - status: Must be a valid video status.
                  - width/height/resolution: Must be valid numbers.
                
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while retrieving
            videos.
      tags: &ref_25
        - videos
      security: &ref_26
        - bearer: []
    post:
      operationId: public_video_create
      summary: Create a new video (public API)
      description: >-
        Creates a new video generation request.


        Required Parameters:

        - prompt: Text description for the video

        - Either originalImageCompletionId, imageUrl or imageUrls must be
        provided


        Optional Parameters:

        - assetUrls: Additional input asset URLs used by some video models

        - organizationId: Organization ID for organization accounts

        - width: Video width in pixels

        - height: Video height in pixels

        - resolution: Video resolution

        - baseModel: Base model identifier for video generation (max 255
        characters)

        - webhookUrl: URL to receive progress notifications

        - hidePrompt: Whether to hide prompt in public listings (default: false)

        - settings: Additional generation settings


        Authentication: Requires valid JWT token.


        Rate Limits: Subject to user account limits.
      parameters: []
      requestBody:
        required: true
        description: Video creation request parameters
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicVideoRequest'
      responses:
        '201':
          description: Video creation request submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoDto'
        '400':
          description: |-
            Bad Request. Possible reasons:

                  - Missing required fields (prompt, originalImageCompletionId or imageUrl)
                  - Invalid field values or formats
                  - Invalid UUID format for originalImageCompletionId or organizationId
                  - Invalid URL format for imageUrl or webhookUrl
                  - Width, height, resolution must be positive integers
                  - Settings must be a valid object
                
        '401':
          description: Unauthorized. Valid JWT token required.
        '402':
          description: Payment Required. Insufficient credit balance.
        '403':
          description: Forbidden. User does not have permission to create videos.
        '404':
          description: Not Found. Referenced originalImageCompletionId does not exist.
        '429':
          description: Too Many Requests. Rate limit exceeded.
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred during video
            creation.
      tags:
        - videos
      security:
        - bearer: []
  /videos/{id}:
    get:
      operationId: public_video_get
      summary: Get video by ID (public API)
      description: >-
        Retrieves a specific video by its UUID.


        Required Parameters:

        - id: UUID of the video


        Note: Only videos based on public, ready, non-NSFW images are
        accessible.
      parameters:
        - name: id
          required: true
          in: path
          description: UUID of the video to retrieve.
          schema:
            type: string
      responses:
        '200':
          description: Returns the video with the specified ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoDto'
        '400':
          description: |-
            Bad Request. Possible reasons:

                  - id: Must be a valid UUID.
                  - Video does not exist.
                  - Invalid or unavailable parameters.
                
        '404':
          description: Not Found. Video with the specified ID does not exist.
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while retrieving
            the video.
      tags: *ref_25
      security: *ref_26
  /videos/{id}/privacy:
    put:
      operationId: public_videos_privacy_change
      summary: Update video privacy
      description: |-
        Changes the privacy settings of a video.

        Path Parameters:
        - id: UUID of the video

        Request Body:
        - privacy: New privacy level (public, private, organization)

        Note: Only works for videos owned by the user.
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the video to update
          schema:
            format: uuid
            type: string
      requestBody:
        required: true
        description: Privacy update parameters.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoPrivacyRequest'
      responses:
        '204':
          description: Video privacy updated successfully
        '400':
          description: Bad Request. Invalid video ID or parameters
        '401':
          description: Unauthorized. Authentication required
        '404':
          description: Not Found. The video could not be found
        '500':
          description: Internal Server Error. Unexpected error occurred
      tags: &ref_27
        - videos
      security: &ref_28
        - bearer: []
  /videos/{id}/prompt-privacy:
    put:
      operationId: public_videos_prompt_privacy_change
      summary: Update video prompt privacy
      description: |-
        Changes the prompt privacy settings of a video.

        Path Parameters:
        - id: UUID of the video

        Request Body:
        - hidePrompt: Boolean indicating if the prompt should be hidden

        Note: Only works for videos owned by the user.
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the video to update
          schema:
            format: uuid
            type: string
      requestBody:
        required: true
        description: Prompt privacy update parameters.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoPromptPrivacyRequest'
      responses:
        '204':
          description: Video prompt privacy updated successfully
        '400':
          description: Bad Request. Invalid video ID or parameters
        '401':
          description: Unauthorized. Authentication required
        '404':
          description: Not Found. The video could not be found
        '500':
          description: Internal Server Error. Unexpected error occurred
      tags: *ref_27
      security: *ref_28
info:
  title: LetzAI API
  description: ''
  version: '1.0'
  contact: {}
tags: []
servers:
  - url: https://api.letz.ai
components:
  securitySchemes:
    Bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: >-
        Authentication via Bearer token: provide a user integration token or an
        organization integration token.
  schemas:
    ImageRequest:
      type: object
      properties:
        prompt:
          type: string
        width:
          type: number
        height:
          type: number
        quality:
          type: number
        creativity:
          type: number
        hasWatermark:
          type: boolean
        systemVersion:
          type: number
        hideFromUserProfile:
          type: boolean
        mode:
          type: string
          enum:
            - default
            - sigma
        webhookUrl:
          type: string
        organizationId:
          type: string
          description: >-
            Organization ID to deduct credits from. If provided, credits will be
            deducted from the organization account instead of the user account.
            User must be a member of the organization.
          example: 123e4567-e89b-12d3-a456-426614174000
        baseModel:
          type: string
          description: Base model identifier used for generation
          example: stable-diffusion-v1
      required:
        - prompt
        - width
        - height
        - quality
        - creativity
        - hasWatermark
        - systemVersion
        - hideFromUserProfile
        - mode
        - webhookUrl
    PublicUserDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        username:
          type: string
        profilePicture:
          type: string
        description:
          type: string
        website:
          type: string
        socialMediaAccounts:
          type: object
        imagesGenerated:
          type: number
        imagesAvailable:
          type: number
        videosGenerated:
          type: number
        videosPublished:
          type: number
        imagesEdited:
          type: number
        editedImagesPublished:
          type: number
        modelsTrained:
          type: number
        modelsAvailable:
          type: number
        followersCount:
          type: number
        followingCount:
          type: number
        isVerified:
          type: boolean
      required:
        - id
        - name
        - username
        - profilePicture
        - description
        - website
        - socialMediaAccounts
        - imagesGenerated
        - imagesAvailable
        - videosGenerated
        - videosPublished
        - imagesEdited
        - editedImagesPublished
        - modelsTrained
        - modelsAvailable
        - followersCount
        - followingCount
        - isVerified
    ModelVersionDto:
      type: object
      properties:
        id:
          type: string
        version:
          type: number
        storagePath:
          type: string
        systemVersions:
          type: array
          items:
            type: string
        status:
          type: string
        createdAt:
          format: date-time
          type: string
        trainedAt:
          format: date-time
          type: string
      required:
        - id
        - version
        - storagePath
        - systemVersions
        - status
        - createdAt
        - trainedAt
    PublicOrganizationDto:
      type: object
      properties: {}
    ModelOrganizationDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the model-organization relationship
          example: 123e4567-e89b-12d3-a456-426614174000
        organization:
          description: Organization that has access to the model
          allOf:
            - $ref: '#/components/schemas/PublicOrganizationDto'
        sharedByUser:
          description: User who shared the model with the organization
          allOf:
            - $ref: '#/components/schemas/PublicUserDto'
        createdAt:
          format: date-time
          type: string
          description: Date when the model was shared
          example: '2024-01-15T10:30:00Z'
        updatedAt:
          format: date-time
          type: string
          description: Date when the sharing was last updated
          example: '2024-01-15T10:30:00Z'
      required:
        - id
        - organization
        - createdAt
        - updatedAt
    ModelDto:
      type: object
      properties:
        id:
          type: string
        user:
          $ref: '#/components/schemas/PublicUserDto'
        userId:
          type: string
        name:
          type: string
        username:
          type: string
        class:
          type: string
        type:
          type: string
        description:
          type: string
        website:
          type: string
        status:
          type: string
        progress:
          type: number
        privacy:
          type: string
        usages:
          type: number
        imagesAvailable:
          type: number
        likes:
          type: number
        version:
          type: number
        thumbnail:
          type: string
        thumbnailOptions:
          type: object
        settings:
          type: object
        images:
          type: object
        isActive:
          type: boolean
        blockedAt:
          format: date-time
          type: string
        createdAt:
          format: date-time
          type: string
        systemVersions:
          type: array
          items:
            type: string
        versions:
          type: array
          items:
            $ref: '#/components/schemas/ModelVersionDto'
      required:
        - id
        - user
        - userId
        - name
        - username
        - class
        - type
        - description
        - website
        - status
        - progress
        - privacy
        - usages
        - imagesAvailable
        - likes
        - version
        - thumbnail
        - thumbnailOptions
        - settings
        - images
        - isActive
        - blockedAt
        - createdAt
        - systemVersions
        - versions
    ImageCompletionDto:
      type: object
      properties:
        id:
          type: string
        user:
          $ref: '#/components/schemas/PublicUserDto'
        userId:
          type: string
        regeneratedFromId:
          type: string
        originalImageCompletions:
          description: Original image completions
          type: array
          items:
            $ref: '#/components/schemas/ImageCompletionDto'
        originalImageCompletion:
          description: Original image completion (top level)
          allOf:
            - $ref: '#/components/schemas/ImageCompletionDto'
        originalImageCompletionIds:
          description: Original image completion IDs
          type: array
          items:
            type: string
        imageEdit:
          $ref: '#/components/schemas/ImageEditDto'
        prompt:
          type: string
        baseModel:
          type: string
        promptSystem:
          type: string
        status:
          type: string
        statusDetail:
          type: string
        progress:
          type: number
        previewImage:
          type: string
        username:
          type: string
        queue:
          type: string
        isUserVerified:
          type: boolean
        isHot:
          type: boolean
        privacy:
          type: string
        likes:
          type: number
        comments:
          type: number
        liked:
          type: boolean
        regenerations:
          type: number
        reports:
          type: number
        storageBucket:
          type: string
        storagePath:
          type: string
        generationSettings:
          type: object
        generationData:
          type: string
        generatedByUnit:
          type: string
        generationSeconds:
          type: number
        imagePaths:
          type: object
        imageVersions:
          type: object
        systemVersion:
          type: number
        hasWatermark:
          type: boolean
        isNsfw:
          type: boolean
        webhookUrl:
          type: string
        isBookmarked:
          type: boolean
        isUnsafe:
          type: boolean
        hidePrompt:
          type: boolean
        blockedAt:
          format: date-time
          type: string
        createdAt:
          format: date-time
          type: string
        deletedAt:
          format: date-time
          type: string
          description: Internal only
        updatedAt:
          format: date-time
          type: string
          description: Internal only
        isActive:
          type: boolean
          description: Internal only
        models:
          type: array
          items:
            $ref: '#/components/schemas/ModelDto'
        modelId:
          type: string
          description: Primary model ID used for generation (first model)
          example: 550e8400-e29b-41d4-a716-446655440000
        apiKey:
          type: string
          description: Organization API key (only included on creation)
      required:
        - id
        - user
        - userId
        - regeneratedFromId
        - originalImageCompletions
        - originalImageCompletion
        - originalImageCompletionIds
        - imageEdit
        - prompt
        - baseModel
        - promptSystem
        - status
        - statusDetail
        - progress
        - previewImage
        - username
        - queue
        - isUserVerified
        - isHot
        - privacy
        - likes
        - comments
        - liked
        - regenerations
        - reports
        - storageBucket
        - storagePath
        - generationSettings
        - generationData
        - generatedByUnit
        - generationSeconds
        - imagePaths
        - imageVersions
        - systemVersion
        - hasWatermark
        - isNsfw
        - webhookUrl
        - isBookmarked
        - isUnsafe
        - hidePrompt
        - blockedAt
        - createdAt
        - models
    ImageEditDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the image edit
        originalImageCompletions:
          description: Original image completions
          type: array
          items:
            $ref: '#/components/schemas/ImageCompletionDto'
        originalImageCompletion:
          description: Original image completion (top level)
          allOf:
            - $ref: '#/components/schemas/ImageCompletionDto'
        originalImageCompletionIds:
          description: Original image completion IDs
          type: array
          items:
            type: string
        originalImageEdit:
          description: Source image completion of the edit
          allOf:
            - $ref: '#/components/schemas/ImageEditDto'
        generatedImageCompletion:
          description: Generated image completion
          allOf:
            - $ref: '#/components/schemas/ImageCompletionDto'
        imageCompletionChoices:
          description: Generated image completion choices
          type: array
          items:
            type: string
        mode:
          type: string
          description: Edit mode (max 32 characters)
          nullable: true
        width:
          type: number
          description: Width of the edited image
        height:
          type: number
          description: Height of the edited image
        imageCompletionsCount:
          type: number
          description: Number of image completions to be generated
        prompt:
          type: string
          description: Prompt
        baseModel:
          type: string
          description: Base model identifier used for generation
        mask:
          type: string
          description: Inpainting mask
        inputImageUrls:
          description: Input image URLs
          type: array
          items:
            type: string
        imageUrl:
          type: string
          description: Input image URL
        webhookUrl:
          type: string
          description: Webhook URL
        settings:
          type: object
        models:
          type: array
          items:
            $ref: '#/components/schemas/ModelDto'
        status:
          type: string
          description: Status of the image edit process
        progress:
          type: number
          description: Progress of the image edit process (0-100)
        generationSeconds:
          type: number
          description: >-
            Generation time in seconds. If provided, overrides the default fixed
            credit cost.
        hidePrompt:
          type: boolean
        apiKey:
          type: string
          description: Organization API key (only included on creation)
      required:
        - id
        - originalImageCompletions
        - originalImageCompletion
        - originalImageCompletionIds
        - originalImageEdit
        - generatedImageCompletion
        - imageCompletionChoices
        - mode
        - width
        - height
        - imageCompletionsCount
        - prompt
        - baseModel
        - mask
        - inputImageUrls
        - imageUrl
        - webhookUrl
        - settings
        - models
        - progress
        - hidePrompt
    ImageDto:
      type: object
      properties:
        id:
          type: string
        user:
          $ref: '#/components/schemas/PublicUserDto'
        imageEdit:
          $ref: '#/components/schemas/ImageEditDto'
        prompt:
          type: string
        baseModel:
          type: string
        status:
          type: string
        progressMessage:
          type: string
        progress:
          type: number
        previewImage:
          type: string
        isHot:
          type: boolean
        privacy:
          type: string
        likes:
          type: number
        regenerations:
          type: number
        imageVersions:
          type: object
        systemVersion:
          type: number
        hasWatermark:
          type: boolean
        generationSettings:
          type: object
        isNsfw:
          type: boolean
        webhookUrl:
          type: string
        hidePrompt:
          type: boolean
        createdAt:
          format: date-time
          type: string
        models:
          type: array
          items:
            $ref: '#/components/schemas/ModelDto'
      required:
        - id
        - user
        - imageEdit
        - prompt
        - baseModel
        - status
        - progressMessage
        - progress
        - previewImage
        - isHot
        - privacy
        - likes
        - regenerations
        - imageVersions
        - systemVersion
        - hasWatermark
        - generationSettings
        - isNsfw
        - webhookUrl
        - hidePrompt
        - createdAt
        - models
    ImagePrivacyRequest:
      type: object
      properties:
        privacy:
          type: string
          enum:
            - public
            - private
            - licensed
      required:
        - privacy
    ImagePromptPrivacyRequest:
      type: object
      properties:
        hidePrompt:
          type: object
          default: false
      required:
        - hidePrompt
    ImageEditRequest:
      type: object
      properties:
        originalImageCompletionIds:
          description: Original image completion IDs
          type: array
          items:
            type: string
        originalImageCompletionId:
          type: string
          description: Original image completion ID
        imageUrl:
          type: string
          description: Input image URL
        mode:
          type: string
          description: Edit mode (max 32 characters)
        width:
          type: number
          description: Width of the edited image
        height:
          type: number
          description: Height of the edited image
        imageCompletionsCount:
          type: number
          description: Number of image completions to generate
        prompt:
          type: string
          description: Prompt
        mask:
          type: string
          description: Inpainting mask
        inputImageUrls:
          description: Input image URLs
          type: array
          items:
            type: string
        settings:
          type: object
        webhookUrl:
          type: string
        hidePrompt:
          type: object
          default: false
        baseModel:
          type: string
          description: Base model identifier used for generation
          example: stable-diffusion-v1
        organizationId:
          type: string
          description: >-
            Organization ID to deduct credits from. If provided, credits will be
            deducted from the organization account instead of the user account.
            User must be a member of the organization.
          example: 123e4567-e89b-12d3-a456-426614174000
        generationSeconds:
          type: number
          description: >-
            Generation time in seconds used to calculate credit cost. If
            provided, overrides the default fixed cost for the edit mode.
          example: 45
      required:
        - imageUrl
        - mode
        - inputImageUrls
        - webhookUrl
        - hidePrompt
    ImageEditMaskDto:
      type: object
      properties:
        mask:
          type: string
          description: Inpainting mask
      required:
        - mask
    SettingsEnum:
      type: string
      enum:
        - NO_VIOLENCE
        - NO_HATE_SPEECH
        - NO_ILLEGAL_CONTENT
        - NO_COPYRIGHTED_CONTENT
        - NO_ADULT_CONTENT
        - NO_RELIGIOUS_CONTENT
        - NO_POLITICAL_CONTENT
        - NO_BRANDED_CONTENT
        - NO_OTHER
    ModelCreateRequest:
      type: object
      properties:
        name:
          type: string
        privacy:
          type: string
          enum:
            - public
            - private
            - licensed
        type:
          type: string
        class:
          type: string
          enum:
            - person
            - style
            - object
        description:
          type: string
        website:
          type: string
        settings:
          type: array
          example:
            - NO_ADULT_CONTENT
            - NO_VIOLENCE
          items:
            $ref: '#/components/schemas/SettingsEnum'
        trainingDataUrls:
          minItems: 1
          maxItems: 50
          type: array
          items:
            type: string
        webhookUrl:
          type: string
        trainingMode:
          type: string
        organizationId:
          type: string
          description: >-
            Organization ID to deduct credits from. If provided, credits will be
            deducted from the organization account instead of the user account.
            User must be a member of the organization.
          example: 123e4567-e89b-12d3-a456-426614174000
      required:
        - name
        - privacy
        - type
        - class
        - description
        - website
        - webhookUrl
        - trainingMode
    ModelUpdateRequest:
      type: object
      properties:
        privacy:
          type: string
          enum:
            - public
            - private
            - licensed
        type:
          type: string
        description:
          type: string
        website:
          type: string
        settings:
          type: array
          items:
            type: string
            enum:
              - NO_VIOLENCE
              - NO_HATE_SPEECH
              - NO_ILLEGAL_CONTENT
              - NO_COPYRIGHTED_CONTENT
              - NO_ADULT_CONTENT
              - NO_RELIGIOUS_CONTENT
              - NO_POLITICAL_CONTENT
              - NO_BRANDED_CONTENT
              - NO_OTHER
        webhookUrl:
          type: string
      required:
        - privacy
        - type
        - description
        - website
    ModelThumbnailRequest:
      type: object
      properties:
        imageCompletionId:
          type: string
          description: >-
            Image completion that should be used as thumbnail for the given
            model
      required:
        - imageCompletionId
    UpscaleRequest:
      type: object
      properties:
        prompt:
          type: string
        mode:
          type: string
          description: Upscale mode (any string, max 32 characters)
        size:
          type: number
        imageId:
          type: string
        imageUrl:
          type: string
        strength:
          type: object
          default: 1
        webhookUrl:
          type: string
        organizationId:
          type: string
          description: >-
            Organization ID to deduct credits from. If provided, credits will be
            deducted from the organization account instead of the user account.
            User must be a member of the organization.
          example: 123e4567-e89b-12d3-a456-426614174000
      required:
        - prompt
        - size
        - imageId
        - imageUrl
        - strength
        - webhookUrl
    UpscaleDto:
      type: object
      properties:
        id:
          type: string
        user:
          $ref: '#/components/schemas/PublicUserDto'
        userId:
          type: string
        imageCompletionId:
          type: string
        imageUrl:
          type: string
        originalImageThumbnail:
          type: string
        status:
          type: string
        mode:
          type: string
        statusDetail:
          type: string
        progress:
          type: number
        username:
          type: string
        createdByUsername:
          type: string
        createdByThumbnail:
          type: string
        isUserVerified:
          type: boolean
        imageVersions:
          type: object
        webhookUrl:
          type: string
        selected:
          type: boolean
        size:
          type: number
        blockedAt:
          format: date-time
          type: string
        createdAt:
          format: date-time
          type: string
        apiKey:
          type: string
          description: Organization API key (only included on creation)
      required:
        - id
        - user
        - userId
        - imageCompletionId
        - imageUrl
        - originalImageThumbnail
        - status
        - mode
        - statusDetail
        - progress
        - username
        - createdByUsername
        - createdByThumbnail
        - isUserVerified
        - imageVersions
        - webhookUrl
        - selected
        - size
        - blockedAt
        - createdAt
    UserImageRequest:
      type: object
      properties:
        extension:
          type: string
          description: >-
            File extension of the image or video. This determines the file
            format that will be uploaded.
          enum:
            - jpg
            - jpeg
            - png
            - gif
            - webp
            - mp4
            - webm
            - mov
            - avi
          example: jpg
        numberOfImages:
          type: object
          description: >-
            Number of images to generate upload URLs for. If you need to upload
            multiple images at once, increase this value.
          default: 1
          example: 1
        originalFilename:
          type: string
          description: >-
            Original filename of the image. This is stored for reference but
            does not affect the actual filename used in storage.
          example: my_photo.jpg
        metadata:
          type: object
          description: >-
            Additional metadata for the image. This can be any JSON object with
            custom properties you want to associate with the image.
          example:
            title: My vacation photo
            tags:
              - vacation
              - beach
      required:
        - extension
    UserImageDto:
      type: object
      properties:
        id:
          type: string
        userId:
          type: string
        imageUrl:
          type: string
          description: >-
            URL to access the uploaded file. This URL will be available after
            uploading the image or video using the uploadUrl.
        uploadUrl:
          type: string
          description: >-
            Pre-signed S3 URL for uploading the file. Make a PUT request to this
            URL with the image or video as the request body and appropriate
            Content-Type header (e.g., image/jpeg, video/mp4).
        originalFilename:
          type: string
        mimeType:
          type: string
        fileSize:
          type: number
        metadata:
          type: object
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
      required:
        - id
        - userId
        - imageUrl
        - createdAt
        - updatedAt
    UserAssetRequest:
      type: object
      properties:
        extension:
          type: string
          description: >-
            File extension of the asset. This determines the file format that
            will be uploaded.
          enum:
            - jpg
            - jpeg
            - png
            - gif
            - webp
            - mp4
            - webm
            - mov
            - avi
            - mp3
            - wav
            - ogg
            - m4a
            - aac
            - flac
          example: jpg
        numberOfImages:
          type: object
          description: >-
            Number of assets to generate upload URLs for. If you need to upload
            multiple files at once, increase this value.
          default: 1
          example: 1
        originalFilename:
          type: string
          description: >-
            Original filename of the asset. This is stored for reference but
            does not affect the actual filename used in storage.
          example: my_photo.jpg
        metadata:
          type: object
          description: >-
            Additional metadata for the asset. This can be any JSON object with
            custom properties you want to associate with the file.
          example:
            title: My vacation photo
            tags:
              - vacation
              - beach
        caption:
          type: string
          description: >-
            Optional caption associated with the asset. Works for image, video,
            and audio assets.
          example: Behind the scenes recording from today.
      required:
        - extension
    UserAssetDto:
      type: object
      properties:
        id:
          type: string
        userId:
          type: string
        imageUrl:
          type: string
          description: >-
            URL to access the uploaded file. This URL will be available after
            uploading the image or video using the uploadUrl.
        uploadUrl:
          type: string
          description: >-
            Pre-signed S3 URL for uploading the file. Make a PUT request to this
            URL with the image or video as the request body and appropriate
            Content-Type header (e.g., image/jpeg, video/mp4).
        originalFilename:
          type: string
        mimeType:
          type: string
        fileSize:
          type: number
        metadata:
          type: object
        caption:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
      required:
        - id
        - userId
        - imageUrl
        - createdAt
        - updatedAt
    UserAssetUpdateRequest:
      type: object
      properties:
        caption:
          type: string
          description: >-
            Optional caption associated with the asset. Works for image, video,
            and audio assets.
          example: Updated caption for this asset.
    VideoDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the video animation
        user:
          description: User who created the video
          allOf:
            - $ref: '#/components/schemas/PublicUserDto'
        userId:
          type: string
          description: User ID of the video creator
        regeneratedFromId:
          type: string
          description: ID of the video this was regenerated from
        originalImageCompletion:
          description: Original image completion being animated
          allOf:
            - $ref: '#/components/schemas/ImageCompletionDto'
        originalImageCompletionId:
          type: string
          description: Original image completion ID
        prompt:
          type: string
          description: Video animation prompt
        prompts:
          type: array
          description: Array of prompt objects for multi-scene videos
          items:
            type: object
        promptSystem:
          type: string
          description: System prompt for video generation
        baseModel:
          type: string
          description: Base model identifier used for video generation
        imageUrls:
          description: Input image URLs
          type: array
          items:
            type: string
        assetUrls:
          description: Input asset URLs
          type: array
          items:
            type: string
        imageUrl:
          type: string
          description: Input image URL
        width:
          type: number
          description: Video width in pixels
        height:
          type: number
          description: Video height in pixels
        resolution:
          type: number
          description: Video resolution
        settings:
          type: object
          description: Video generation settings
        generationSettings:
          type: object
          description: Generation settings used for the video
        status:
          type: string
          description: Status of the video animation process
        statusDetail:
          type: string
          description: Detailed status information
        progress:
          type: number
          description: Generation progress percentage (0-100)
        previewImage:
          type: string
          description: Preview image URL for the video
        queue:
          type: string
          description: Processing queue type
        systemVersion:
          type: number
          description: System version used for generation
        generationSeconds:
          type: number
          description: Generation time in seconds
        videoVersions:
          type: object
          description: Generated video file versions
        videoPaths:
          type: object
          description: 'Internal only: raw video paths'
        imageCompletionsCount:
          type: number
          description: 'Internal only: image completions count'
        deletedAt:
          format: date-time
          type: string
          description: Internal only
        updatedAt:
          format: date-time
          type: string
          description: Internal only
        imageVersions:
          type: object
          description: Generated image file versions
        storageBucket:
          type: string
          description: Storage bucket for video files
        storagePath:
          type: string
          description: Storage path for video files
        webhookUrl:
          type: string
          description: Webhook URL for completion notification
        hidePrompt:
          type: boolean
          description: Whether to hide the prompt from public view
        hasWatermark:
          type: boolean
          description: Whether the video has a watermark
        likes:
          type: number
          description: Number of likes for this video
        comments:
          type: number
          description: Number of comments for this video
        regenerations:
          type: number
          description: Number of regenerations/remixes of this video
        reports:
          type: number
          description: Number of reports for inappropriate content
        privacy:
          type: string
          description: Privacy setting for the video
        isNsfw:
          type: boolean
          description: Whether the video contains NSFW content
        isHot:
          type: boolean
          description: Whether the video is flagged as trending/hot
        liked:
          type: boolean
          description: Whether the current user has liked this video
        isUnsafe:
          type: boolean
          description: Whether the video is flagged as unsafe content
        isActive:
          type: boolean
          description: Whether the video is actively available
        hideFromUserProfile:
          type: boolean
          description: Whether to hide the video from user profile
        isBookmarked:
          type: boolean
          description: Whether the current user has bookmarked this video
        username:
          type: string
          description: Username of the video creator
        isUserVerified:
          type: boolean
          description: Whether the creator is a verified user
        publishedAt:
          format: date-time
          type: string
          description: When the video was published/made public
        blockedAt:
          format: date-time
          type: string
          description: When the video was blocked (if applicable)
        createdAt:
          format: date-time
          type: string
          description: Creation timestamp
        models:
          description: Models used for video generation
          type: array
          items:
            $ref: '#/components/schemas/ModelDto'
        apiKey:
          type: string
          description: Organization API key (only included on creation)
      required:
        - id
        - user
        - userId
        - regeneratedFromId
        - originalImageCompletion
        - originalImageCompletionId
        - prompt
        - prompts
        - promptSystem
        - baseModel
        - imageUrls
        - assetUrls
        - imageUrl
        - width
        - height
        - resolution
        - settings
        - generationSettings
        - statusDetail
        - progress
        - previewImage
        - queue
        - systemVersion
        - generationSeconds
        - videoVersions
        - imageVersions
        - storageBucket
        - storagePath
        - webhookUrl
        - hidePrompt
        - hasWatermark
        - likes
        - comments
        - regenerations
        - reports
        - privacy
        - isNsfw
        - isHot
        - liked
        - isUnsafe
        - isActive
        - hideFromUserProfile
        - isBookmarked
        - username
        - isUserVerified
        - publishedAt
        - blockedAt
        - createdAt
        - models
    PublicVideoRequest:
      type: object
      properties:
        originalImageCompletionId:
          type: string
          description: Original image completion ID to create video from
          example: 123e4567-e89b-12d3-a456-426614174000
        imageUrls:
          description: Input image URLs
          type: array
          items:
            type: string
        assetUrls:
          description: Input asset URLs (e.g. face images for Seedance)
          type: array
          items:
            type: string
        imageUrl:
          type: string
          description: >-
            Image URL to create video from (alternative to
            originalImageCompletionId)
          example: https://example.com/image.jpg
        organizationId:
          type: string
          description: Organization ID (for organization accounts)
          example: 123e4567-e89b-12d3-a456-426614174000
        width:
          type: number
          description: Width of the video
          example: 1024
        height:
          type: number
          description: Height of the video
          example: 1024
        resolution:
          type: number
          description: Resolution of the video
          example: 1024
        prompt:
          type: string
          description: Prompt for video generation
          example: A beautiful sunset over the ocean
        prompts:
          type: array
          description: Array of prompt objects for multi-scene videos
          items:
            type: object
          example:
            - prompt: Scene 1 description
              duration: 3
        baseModel:
          type: string
          description: Base model identifier for video generation
          example: stable-diffusion-v1
        webhookUrl:
          type: string
          description: Webhook URL to receive notifications about video generation progress
          example: https://your-app.com/webhook/video-complete
        hidePrompt:
          type: object
          description: Whether to hide the prompt in public listings
          default: false
          example: false
        settings:
          type: object
          description: Additional settings for video generation
          example:
            mode: video-kling26
            withSound: false
            highQuality: true
            duration: 4
      required:
        - prompt
    VideoPrivacyRequest:
      type: object
      properties:
        privacy:
          type: string
          enum:
            - public
            - private
            - licensed
      required:
        - privacy
    VideoPromptPrivacyRequest:
      type: object
      properties:
        hidePrompt:
          type: object
          description: Whether to hide the prompt from public view
          default: false
      required:
        - hidePrompt
