> ## 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.

# Get Agent Run Logs

> Retrieve an agent run with its logs using pagination. This endpoint is currently in ALPHA and IS subject to change.

Returns the agent run details along with a paginated list of logs for the specified agent run.
The agent run must belong to the specified organization. Logs are returned in chronological order.
Uses standard pagination parameters (skip and limit) and includes pagination metadata in the response.

Rate limit: 60 requests per 60 seconds.



## OpenAPI

````yaml api-reference/openapi3.json get /v1/alpha/organizations/{org_id}/agent/run/{agent_run_id}/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/alpha/organizations/{org_id}/agent/run/{agent_run_id}/logs:
    get:
      tags:
        - agents-alpha
        - agents-alpha
        - agents-beta
      summary: Get Agent Run Logs
      description: >-
        Retrieve an agent run with its logs using pagination. This endpoint is
        currently in ALPHA and IS subject to change.


        Returns the agent run details along with a paginated list of logs for
        the specified agent run.

        The agent run must belong to the specified organization. Logs are
        returned in chronological order.

        Uses standard pagination parameters (skip and limit) and includes
        pagination metadata in the response.


        Rate limit: 60 requests per 60 seconds.
      operationId: >-
        get_agent_run_logs_v1_alpha_organizations__org_id__agent_run__agent_run_id__logs_get
      parameters:
        - name: agent_run_id
          in: path
          required: true
          schema:
            type: integer
            title: Agent Run Id
        - name: org_id
          in: path
          required: true
          schema:
            type: integer
            title: Org Id
        - name: skip
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Skip
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 100
            title: Limit
        - name: reverse
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Reverse
        - name: authorization
          in: header
          required: false
          schema:
            title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunWithLogsResponse'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionsErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunNotFoundErrorResponse'
          description: 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:
    AgentRunWithLogsResponse:
      properties:
        id:
          type: integer
          title: Id
        organization_id:
          type: integer
          title: Organization Id
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        web_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Web Url
        result:
          anyOf:
            - type: string
            - type: 'null'
          title: Result
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        logs:
          items:
            $ref: '#/components/schemas/AgentRunLogResponse'
          type: array
          title: Logs
        total_logs:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Logs
        page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page
        size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Size
        pages:
          anyOf:
            - type: integer
            - type: 'null'
          title: Pages
      type: object
      required:
        - id
        - organization_id
        - logs
      title: AgentRunWithLogsResponse
      description: Represents an agent run in API responses
    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
    AgentRunNotFoundErrorResponse:
      properties:
        message:
          type: string
          title: Message
          default: Agent run not found.
        status_code:
          type: integer
          title: Status Code
          default: 404
      type: object
      title: AgentRunNotFoundErrorResponse
    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
    AgentRunLogResponse:
      properties:
        agent_run_id:
          type: integer
          title: Agent Run Id
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        tool_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Name
        message_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Message Type
        thought:
          anyOf:
            - type: string
            - type: 'null'
          title: Thought
        observation:
          anyOf:
            - additionalProperties: true
              type: object
            - type: string
            - type: 'null'
          title: Observation
        tool_input:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Tool Input
        tool_output:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Tool Output
      type: object
      required:
        - agent_run_id
      title: AgentRunLogResponse
      description: Represents an agent run log in API responses
    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

````