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

# Run Command

> Run a command and return its stdout, stderr and exit code.



## OpenAPI

````yaml post /v1/sandboxes/{sandbox_id}/commands
openapi: 3.1.0
info:
  title: Noxus Backend
  description: >-
    Backend API for the Noxus Platform. More information can be found at
    https://docs.noxus.ai
  version: 1.1.0
servers: []
security: []
paths:
  /v1/sandboxes/{sandbox_id}/commands:
    post:
      tags:
        - V1 - Sandboxes
      summary: Run Command
      description: Run a command and return its stdout, stderr and exit code.
      operationId: run_command
      parameters:
        - name: sandbox_id
          in: path
          required: true
          schema:
            type: string
            title: Sandbox Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunCommandIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    RunCommandIn:
      properties:
        command:
          type: string
          title: Command
          description: Shell command to run inside the sandbox.
        timeout:
          anyOf:
            - type: integer
              maximum: 3600
              minimum: 1
            - type: 'null'
          title: Timeout
          description: Seconds before the command is killed.
      type: object
      required:
        - command
      title: RunCommandIn
    ExecutionOut:
      properties:
        stdout:
          type: string
          title: Stdout
        stderr:
          type: string
          title: Stderr
        exit_code:
          type: integer
          title: Exit Code
        timed_out:
          type: boolean
          title: Timed Out
      type: object
      required:
        - stdout
        - stderr
        - exit_code
        - timed_out
      title: ExecutionOut
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````