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

# Cancel AI task

> Stopping a previously launched AI-task without waiting for it to be fully completed.

The task will be moved to "REVOKED" status.



## OpenAPI

````yaml /api-reference/services_docs_mintlify/streaming_api.yaml post /streaming/ai/tasks/{task_id}/cancel
openapi: 3.1.0
info:
  title: Gcore OpenAPI – Streaming API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: a41613cd4a9e
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: AI
  - name: Broadcasts
  - name: Directories
  - name: Overlays
  - name: Players
  - name: Playlists
  - name: QualitySets
  - name: Restreams
  - name: Statistics
  - name: Streams
  - name: Subtitles
  - name: Videos
paths:
  /streaming/ai/tasks/{task_id}/cancel:
    post:
      tags:
        - AI
      summary: Cancel AI task
      description: >-
        Stopping a previously launched AI-task without waiting for it to be
        fully completed.


        The task will be moved to "REVOKED" status.
      operationId: post_ai_tasks_cancel
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
          description: ID of the task to be cancelled
      responses:
        '202':
          description: Accepted. AI-task has been cancelled successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ai_post_response_result'
        '400':
          description: |-
            Bad request:
            - "task_id" is not specified,
            - Queue limit reached (100), try later,
            - etc
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ai_post_response_error404'
        '412':
          description: >-
            Precondition Failed. AI-task can't be cancelled, because it is
            already cancelled or completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ai_post_response_error'
        '422':
          description: >-
            This is advanced functionality; to enable it, contact your manager
            or the Support Team.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/upgraderequired'
components:
  schemas:
    ai_post_response_result:
      type: object
      properties:
        result:
          type: string
          description: A textual explicit description of the result of the operation
      example:
        result: Task has been cancelled successfully.
    error:
      type: object
      properties:
        error:
          type: string
          description: Text message with description of error.
      example:
        error: Queue limit reached (100), try later.
    ai_post_response_error404:
      allOf:
        - $ref: '#/components/schemas/ai_post_response_error'
      example:
        error: Task not found
    ai_post_response_error:
      type: object
      properties:
        error:
          type: string
          description: >-
            A textual explicit description of the operation execution error, if
            something went wrong
      example:
        error: Cannot cancel task because it is already in status REVOKED.
    upgraderequired:
      type: object
      properties:
        error:
          type: string
          description: >-
            This is advanced functionality; to enable it, contact your manager
            or support service.
      example:
        error: Feature is disabled. Contact support to enable.
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````