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

# Start Upscaling Task

> This endpoint processes an upscaling task request, including file uploads.




## OpenAPI

````yaml post /start-task
openapi: 3.0.2
info:
  title: Upscayl Cloud API
  description: |
    API for Upscayl Cloud - An AI-powered image upscaling service.
    Use this API to upscale images, check processing status, and manage uploads.
  version: 1.0.0
  contact:
    name: Upscayl Support
    url: mailto:support@upscayl.org
servers:
  - url: https://api.upscayl.org
    description: Upscayl Server
security: []
paths:
  /start-task:
    post:
      summary: Start Upscaling Task
      description: >
        This endpoint processes an upscaling task request, including file
        uploads.
      operationId: startTask
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - enhanceFace
                - model
                - scale
                - saveImageAs
              properties:
                file:
                  type: string
                  format: binary
                  description: >-
                    The image file to be processed. Supported formats: JPG, PNG,
                    WEBP.
                files:
                  type: array
                  items:
                    $ref: '#/components/schemas/FileData'
                  description: >-
                    The files to be processed. **This is to be only used with
                    'Get Upload URL' endpoint.**
                urls:
                  type: array
                  items:
                    type: string
                    format: uri
                  description: Array of URLs pointing to images to be processed.
                model:
                  $ref: '#/components/schemas/Model'
                scale:
                  $ref: '#/components/schemas/Scale'
                saveImageAs:
                  $ref: '#/components/schemas/SaveImageAs'
                enhanceFace:
                  type: boolean
                  description: Whether to enhance faces in the image.
              oneOf:
                - required:
                    - file
                - required:
                    - files
                - required:
                    - urls
      responses:
        '200':
          description: Task request sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        description: The message returned.
                        example: Task request sent successfully
                      taskId:
                        type: string
                        description: >-
                          The ID of the task that you can use to check the
                          status.
                        example: 123e4567-e89b-12d3-a456-426614174000
                      creditsToDeduct:
                        type: integer
                        description: The number of credits to deduct for the task.
                        example: 10
          headers:
            x-task-cost:
              schema:
                type: integer
              description: The number of credits deducted for the task.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: string
                example: 'Bad Request: Missing User'
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                type: string
                example: Insufficient credits
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                example: User not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                example: Error processing request
      security:
        - ApiKeyAuth: []
components:
  schemas:
    FileData:
      type: object
      properties:
        fileName:
          type: string
          description: The name of the file.
          example: 1k2jj2b3c-cnb1234ij.jpg
        fileType:
          type: string
          description: The MIME type of the file.
          example: image/jpeg
        fileSize:
          type: integer
          description: The size of the file in bytes.
          example: 123456
        originalFileName:
          type: string
          description: The original name of the file.
          example: image.jpg
        path:
          type: string
          description: The path where the file is stored.
          example: users/1412v4124v/1k2jj2b3c-cnb1234ij.jpg
        createdAt:
          type: integer
          description: Timestamp of file creation.
          example: 1640995200
        expiresAt:
          type: integer
          description: Timestamp of file expiration.
          example: 1640995200
        dimensions:
          type: object
          properties:
            width:
              type: integer
              description: The width of the image.
            height:
              type: integer
              description: The height of the image.
    Model:
      type: string
      enum:
        - upscayl-standard-4x
        - upscayl-lite-4x
        - clear-boost-4x
        - crystal-plus-4x
        - digital-art-4x
        - digital-art-plus-4x
        - natural-max-4x
        - natural-plus-4x
        - nature-boost-4x
        - pure-boost-4x
        - quick-clear-4x
        - texture-boost-4x
      description: The available AI models for upscaling
    Scale:
      type: integer
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
      description: The scaling factor for the task
      example: 4
    SaveImageAs:
      type: string
      enum:
        - jpg
        - png
        - webp
      description: The available image formats for saving
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >
        API key required to access the API. You can obtain an API key at
        [https://upscayl.org/account/api-keys](https://upscayl.org/account/api-keys)

````