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

# Analyze Sandbox Logs

> Analyze sandbox setup logs using an AI agent.

This endpoint creates an AI agent that will analyze the setup logs from a sandbox,
identify any errors, provide insights about what went wrong, and suggest potential
solutions. The analysis runs asynchronously and results can be retrieved using the
returned agent run ID.

Rate limit: 5 requests per minute.



## OpenAPI

````yaml api-reference/openapi3.json post /v1/organizations/{org_id}/sandbox/{sandbox_id}/analyze-logs
openapi: 3.1.0
info:
  title: Developer API
  description: API for application developers
  version: 1.0.0
servers:
  - url: https://api.codegen.com
    description: Codegen API
security: []
paths:
  /v1/organizations/{org_id}/sandbox/{sandbox_id}/analyze-logs:
    post:
      tags:
        - sandbox
        - sandbox
        - sandbox
      summary: Analyze Sandbox Logs
      description: >-
        Analyze sandbox setup logs using an AI agent.


        This endpoint creates an AI agent that will analyze the setup logs from
        a sandbox,

        identify any errors, provide insights about what went wrong, and suggest
        potential

        solutions. The analysis runs asynchronously and results can be retrieved
        using the

        returned agent run ID.


        Rate limit: 5 requests per minute.
      operationId: >-
        analyze_sandbox_logs_v1_organizations__org_id__sandbox__sandbox_id__analyze_logs_post
      parameters:
        - name: sandbox_id
          in: path
          required: true
          schema:
            type: integer
            title: Sandbox Id
        - name: org_id
          in: path
          required: true
          schema:
            type: integer
            title: Org Id
        - name: authorization
          in: header
          required: false
          schema:
            title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyzeLogsResponse'
        '400':
          description: No logs available for analysis
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionsErrorResponse'
          description: Forbidden
        '404':
          description: Sandbox not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIRateLimitErrorResponse'
          description: Too Many Requests
components:
  schemas:
    AnalyzeLogsResponse:
      properties:
        agent_run_id:
          type: integer
          title: Agent Run Id
          description: The ID of the agent run analyzing the logs
        status:
          type: string
          title: Status
          description: The status of the agent run
        message:
          type: string
          title: Message
          description: Information about the analysis process
      type: object
      required:
        - agent_run_id
        - status
        - message
      title: AnalyzeLogsResponse
    PermissionsErrorResponse:
      properties:
        message:
          type: string
          title: Message
          default: You do not have access to this organization.
        status_code:
          type: integer
          title: Status Code
          default: 403
      type: object
      title: PermissionsErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    APIRateLimitErrorResponse:
      properties:
        message:
          type: string
          title: Message
          default: Rate limit exceeded. Please try again later.
        status_code:
          type: integer
          title: Status Code
          default: 429
      type: object
      title: APIRateLimitErrorResponse
    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

````