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

# Clear a model's pending jobs

> Cancel all pending jobs for the given model. Running jobs are left untouched. Returns the number of jobs that were canceled.



## OpenAPI

````yaml POST /queue/clear
openapi: 3.1.0
info:
  title: Together APIs
  description: The Together REST API. See https://docs.together.ai for more details.
  version: 2.0.0
  termsOfService: https://www.together.ai/terms-of-service
  contact:
    name: Together Support
    url: https://www.together.ai/contact
  license:
    name: MIT
    url: https://github.com/togethercomputer/openapi/blob/main/LICENSE
servers:
  - url: https://api.together.ai/v1
    description: Default environment for APIs
  - url: https://api-inference.together.ai/v2
    description: Optimized environment for inference
security:
  - bearerAuth: []
paths:
  /queue/clear:
    post:
      tags:
        - Queue
      summary: Clear a model's pending jobs
      description: >-
        Cancel all pending jobs for the given model. Running jobs are left
        untouched. Returns the number of jobs that were canceled.
      operationId: clearQueue
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueueClearRequest'
        description: Clear request
        required: true
      responses:
        '200':
          description: Pending jobs canceled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueueClearResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueueError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueueError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueueError'
components:
  schemas:
    QueueClearRequest:
      description: Request to clear pending jobs for a model.
      properties:
        model:
          description: Model identifier whose pending jobs should be canceled
          type: string
      required:
        - model
      type: object
    QueueClearResponse:
      description: Count of pending jobs canceled by the clear operation.
      type: object
      required:
        - canceled_count
      properties:
        canceled_count:
          description: Number of pending jobs that were canceled
          type: integer
    QueueError:
      description: Error response returned by queue endpoints.
      properties:
        code:
          description: Machine-readable error code
          type: string
        message:
          description: Human-readable error message
          type: string
        param:
          description: The parameter that caused the error, if applicable
          type: string
        type:
          description: Error category (e.g. "invalid_request_error", "not_found_error")
          type: string
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      x-bearer-format: bearer
      x-default: default

````