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

> ## Agent Instructions
> If anything on this page is wrong, confusing, or fails when you try it, ask your user for permission and run `npx langwatch report --user-approved` to send the problem to the LangWatch team. No login is needed and secrets are redacted locally. `npx langwatch report --help` has the details.

# Cancel a run

> Ask a run to stop. The run stops before its next page, so the pages it already judged keep their judgements and are still readable. A run that has already finished, failed or been cancelled answers 409 instant_eval_already_finished.



## OpenAPI

````yaml POST /api/v1/instant-evals/{id}/cancel
openapi: 3.1.0
info:
  title: LangWatch API
  version: 1.0.0
  description: LangWatch openapi spec
servers:
  - url: https://app.langwatch.ai
security:
  - project_api_key: []
paths:
  /api/v1/instant-evals/{id}/cancel:
    post:
      tags:
        - Instant Evals
      summary: Cancel a run
      description: >-
        Ask a run to stop. The run stops before its next page, so the pages it
        already judged keep their judgements and are still readable. A run that
        has already finished, failed or been cancelled answers 409
        instant_eval_already_finished.
      operationId: cancelInstantEvalRun
      parameters:
        - in: path
          name: id
          schema:
            type: string
            minLength: 1
          required: true
          description: The run id.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The run id.
                  name:
                    type:
                      - string
                      - 'null'
                    description: What the run was called, if anything.
                  sql:
                    type: string
                    description: The statement, exactly as submitted.
                  parameters:
                    type: object
                    additionalProperties:
                      anyOf:
                        - type: string
                        - type: number
                        - type: boolean
                        - type: 'null'
                    description: The values the statement's parameters were filled with.
                  questions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: >-
                            The statement's own output column, which is the name
                            this question is addressed by everywhere else.
                        function:
                          type: string
                          description: The eval function that asked it.
                        kind:
                          type: string
                          enum:
                            - boolean
                            - score
                            - category
                          description: What kind of answer the question takes.
                        reads:
                          type: string
                          description: >-
                            Which part of the verdict the statement's column
                            carries.
                        threshold:
                          type:
                            - number
                            - 'null'
                          description: >-
                            Where a boolean question's probability becomes a
                            pass. Null for a question that is not a boolean.
                      required:
                        - id
                        - function
                        - kind
                        - reads
                        - threshold
                    description: >-
                      One entry per eval function the statement projects,
                      derived from it when the run was accepted.
                  limit:
                    type: integer
                    description: Rows this run may judge.
                  status:
                    type: string
                    enum:
                      - queued
                      - planning
                      - running
                      - finished
                      - failed
                      - cancelled
                    description: Where the run is in its life.
                  total:
                    type:
                      - integer
                      - 'null'
                    description: >-
                      Rows the run found, bounded by its limit. Null until it
                      has looked.
                  progress:
                    type: integer
                    description: Rows judged so far.
                  matched:
                    type:
                      - integer
                      - 'null'
                    description: >-
                      Judgements that matched, across this run's boolean
                      questions. Null when the run asked none: a score or a
                      category question has no match to count.
                  matchedByQuestion:
                    type: object
                    additionalProperties:
                      type: number
                    description: >-
                      Per question: matches for a boolean question, judged rows
                      for a score or a category one.
                  failed:
                    type: integer
                    description: Rows the judge could not answer.
                  skipped:
                    type: integer
                    description: Rows the judge declined to answer.
                  tokens:
                    type: integer
                    description: Input tokens the judge billed for.
                  priceUsd:
                    type: number
                    description: What the judging costs you, in United States dollars.
                  error:
                    type:
                      - string
                      - 'null'
                    description: The code of the failure that ended the run, when one did.
                  createdAt:
                    type: string
                    description: When the run was accepted.
                  updatedAt:
                    type: string
                    description: When the run was last written to.
                  startedAt:
                    type:
                      - string
                      - 'null'
                    description: When the run began reading rows.
                  finishedAt:
                    type:
                      - string
                      - 'null'
                    description: When the run ended.
                required:
                  - id
                  - name
                  - sql
                  - parameters
                  - questions
                  - limit
                  - status
                  - total
                  - progress
                  - matched
                  - matchedByQuestion
                  - failed
                  - skipped
                  - tokens
                  - priceUsd
                  - error
                  - createdAt
                  - updatedAt
                  - startedAt
                  - finishedAt
      security:
        - project_api_key: []
components:
  securitySchemes:
    project_api_key:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: >-
        Project API key for sending traces and accessing project-scoped
        resources. Format: sk-lw-... (no underscore). Obtain one by creating a
        project via the Admin API or the LangWatch UI.

````