> ## 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.

# Get Task Status

> This endpoint retrieves the status of a task, including whether it has been processed, credits deducted, and file download links.
It also handles credit deduction if the task is processed and credits have not been deducted yet.




## OpenAPI

````yaml post /get-task-status
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:
  /get-task-status:
    post:
      summary: Get Task Status
      description: >
        This endpoint retrieves the status of a task, including whether it has
        been processed, credits deducted, and file download links.

        It also handles credit deduction if the task is processed and credits
        have not been deducted yet.
      operationId: getTaskStatus
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  properties:
                    taskId:
                      type: string
                      description: The ID of the task to retrieve the status for.
      responses:
        '200':
          description: Task status retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      status:
                        $ref: '#/components/schemas/Status'
                      progress:
                        type: string
                        example: '100'
                      files:
                        type: array
                        items:
                          $ref: '#/components/schemas/FileData'
                      deductedCredits:
                        type: integer
                        example: 10
                      creditsDeducted:
                        type: boolean
                        example: true
                      model:
                        $ref: '#/components/schemas/Model'
                      scale:
                        $ref: '#/components/schemas/Scale'
                      saveImageAs:
                        type: string
                        example: png
                      compression:
                        type: integer
                        example: 80
                      batchMode:
                        type: boolean
                        example: false
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                example: 'Bad Request: Missing User ID'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                example: Error getting data
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Status:
      type: string
      enum:
        - ENHANCING
        - PROCESSING
        - PROCESSED
        - PROCESSING_FAILED
      description: The status of the task
    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
  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)

````