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

# Execute Code



## OpenAPI

````yaml /openapi.json post /api/v1/coding/sessions/{session_id}/execute
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/coding/sessions/{session_id}/execute:
    post:
      tags:
        - Coding Tasks
      summary: Execute Code
      operationId: execute_code_api_v1_coding_sessions__session_id__execute_post
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Session Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteCodeRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecuteCodeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ExecuteCodeRequest:
      properties:
        code:
          type: string
          title: Code
        timeout_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Timeout Seconds
      type: object
      required:
        - code
      title: ExecuteCodeRequest
    ExecuteCodeResponse:
      properties:
        stdout:
          type: string
          title: Stdout
          default: ''
        stderr:
          type: string
          title: Stderr
          default: ''
        exit_code:
          type: integer
          title: Exit Code
          default: 0
        execution_time_ms:
          type: integer
          title: Execution Time Ms
          default: 0
      type: object
      title: ExecuteCodeResponse
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````