> ## Documentation Index
> Fetch the complete documentation index at: https://browseruse-0aece648-larsen-v1-unified-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Stop Browsercode Run

> End a browsercode run (queued OR running). Returns the run in `stopped`.
MOCKED.



## OpenAPI

````yaml /cloud/openapi/v1.json post /agents/browsercode/runs/{run_id}/stop
openapi: 3.1.0
info:
  title: Browser Use API v1
  summary: Unified /api/v1 preview spec, non-production only
  version: 1.0.0
servers:
  - url: https://api-staging-ufcbwvyv9yifyyvc3.browser-use.com/api/v1
    description: Browser Use API v1 (staging)
security: []
paths:
  /agents/browsercode/runs/{run_id}/stop:
    post:
      tags:
        - 'Agent: browsercode'
      summary: Stop Browsercode Run
      description: |-
        End a browsercode run (queued OR running). Returns the run in `stopped`.
        MOCKED.
      operationId: stop_browsercode_run_agents_browsercode_runs__run_id__stop_post
      parameters:
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            title: Run Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrowsercodeRun'
        '404':
          description: Run not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrowsercodeRunNotFoundError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    BrowsercodeRun:
      properties:
        id:
          type: string
          title: Id
          description: Run id, e.g. "run_...".
        agent:
          type: string
          enum:
            - browser-use
            - browsercode
          title: Agent
          description: Always 'browsercode'.
          default: browsercode
        status:
          type: string
          enum:
            - queued
            - running
            - completed
            - failed
            - stopped
          title: Status
        sessionId:
          type: string
          format: uuid
          title: Sessionid
          description: The conversation this run belongs to.
        workspaceId:
          type: string
          format: uuid
          title: Workspaceid
          description: The run's workspace; its files live here.
        browserId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Browserid
          description: >-
            The browser this run used. Null until provisioned; persists after
            completion.
        model:
          type: string
          title: Model
        result:
          anyOf:
            - type: string
            - type: 'null'
          title: Result
          description: Short answer summary. Null until the run completes.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Failure reason, if the run failed.
        totalInputTokens:
          type: integer
          title: Totalinputtokens
          default: 0
        totalOutputTokens:
          type: integer
          title: Totaloutputtokens
          default: 0
        totalCostUsd:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Totalcostusd
          description: USD billed to the project.
          default: '0'
        missingFileIds:
          items:
            type: string
            format: uuid
          type: array
          title: Missingfileids
        createdAt:
          type: string
          format: date-time
          title: Createdat
        updatedAt:
          type: string
          format: date-time
          title: Updatedat
      type: object
      required:
        - id
        - status
        - sessionId
        - workspaceId
        - model
        - createdAt
        - updatedAt
      title: BrowsercodeRun
      description: >-
        A browsercode run, as returned by POST /runs and GET /runs/{id}.


        On completion: `result` is the short answer string. Real/structured
        output is

        a FILE — GET /runs/{id}/files?kind=output (browsercode has no
        structuredOutput

        param; you put the shape in the task and fetch the file).
    BrowsercodeRunNotFoundError:
      properties:
        detail:
          type: string
          title: Detail
          default: Run not found
      type: object
      title: BrowsercodeRunNotFoundError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-Browser-Use-API-Key

````