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

# Delete a run

> Delete a stored Agent run.

<Warning>
  Exa Agent is in beta. It requires `Exa-Beta: agent-2026-05-07` on every request.
</Warning>

Deleting a run removes the stored run from your team's Agent run history.

<Card title="Get your Exa API key" icon="key" horizontal href="https://dashboard.exa.ai/api-keys" />


## OpenAPI

````yaml delete /agent/runs/{id}
openapi: 3.1.0
info:
  title: Exa Public API
  version: 2.0.0
servers:
  - url: https://api.exa.ai
security:
  - apiKey: []
  - bearer: []
tags: []
paths:
  /agent/runs/{id}:
    delete:
      tags:
        - Agent
      summary: Delete a run
      description: Delete a stored Agent run.
      operationId: deleteAgentRun
      parameters:
        - in: path
          name: id
          schema:
            $ref: '#/components/schemas/AgentRunId'
            description: Agent run ID.
          required: true
          description: Agent run ID.
        - $ref: '#/components/parameters/ExaBetaHeader'
      responses:
        '200':
          description: Agent run deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteAgentRunResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentErrorResponse'
        '401':
          description: Team context or authentication was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentErrorResponse'
        '404':
          description: Run not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentErrorResponse'
        '429':
          description: Agent run concurrency limit reached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentErrorResponse'
        '500':
          description: Server error or run timeout.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentErrorResponse'
      x-codeSamples:
        - lang: python
          label: Delete a run
          source: |-
            from exa_py import Exa

            exa = Exa(api_key="YOUR_EXA_API_KEY")
            run_id = "agent_run_01j..."
            deleted = exa.beta.agent.runs.delete(
                run_id,
                betas=["agent-2026-05-07"],
            )
            print(deleted)
        - lang: typescript
          label: Delete a run
          source: |-
            import Exa from "exa-js";

            const exa = new Exa();
            const runId = "agent_run_01j...";
            const deleted = await exa.beta.agent.runs.delete(runId, {
              betas: ["agent-2026-05-07"]
            });

            console.log(deleted);
        - lang: bash
          label: Delete a run
          source: |-
            curl -s -X DELETE "https://api.exa.ai/agent/runs/agent_run_01j..." \
              -H "x-api-key: $EXA_API_KEY" \
              -H "Exa-Beta: agent-2026-05-07"
components:
  schemas:
    AgentRunId:
      type: string
      minLength: 1
      maxLength: 200
      pattern: ^[A-Za-z0-9_.:-]+$
      description: Agent run ID. New run IDs are returned with the `agent_run_` prefix.
      example: agent_run_01j7x9v0m2n4p6q8r0s2t4v6w8
    DeleteAgentRunResponse:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/AgentRunId'
        object:
          type: string
          const: agent_run.deleted
        deleted:
          type: boolean
          const: true
      required:
        - id
        - object
        - deleted
      additionalProperties: false
    AgentErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/AgentError'
      required:
        - error
      additionalProperties: false
    AgentError:
      type: object
      properties:
        type:
          type: string
          enum:
            - INVALID_REQUEST
            - AUTHENTICATION_ERROR
            - RATE_LIMIT_ERROR
            - NOT_FOUND
            - SERVER_ERROR
        code:
          type: string
          enum:
            - INVALID_REQUEST
            - MISSING_BETA_HEADER
            - INVALID_BETA_HEADER
            - TEAM_NOT_FOUND
            - RUN_NOT_FOUND
            - PREVIOUS_RUN_NOT_FOUND
            - PREVIOUS_RUN_NOT_COMPLETED
            - CONCURRENCY_LIMIT_REACHED
            - INVALID_OUTPUT_SCHEMA
            - TIMEOUT
            - SERVER_ERROR
        message:
          type: string
      required:
        - type
        - code
        - message
      additionalProperties:
        $ref: '#/components/schemas/JsonValue'
    JsonValue:
      description: Any JSON value.
      oneOf:
        - type: 'null'
        - type: boolean
        - type: number
        - type: string
        - type: array
          items:
            $ref: '#/components/schemas/JsonValue'
        - type: object
          propertyNames:
            type: string
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
  parameters:
    ExaBetaHeader:
      in: header
      name: Exa-Beta
      schema:
        type: string
        enum:
          - agent-2026-05-07
        description: Required beta token for the Agent.
      required: true
      description: Required beta token for the Agent.
  securitySchemes:
    apiKey:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        Pass your Exa API key in the x-api-key header. You can also authenticate
        with Authorization: Bearer <key>.
    bearer:
      type: http
      scheme: bearer
      description: >-
        Pass your Exa API key in the x-api-key header. You can also authenticate
        with Authorization: Bearer <key>.

````