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

# Get Deployment Logs

> Get structured log lines for a deployment with cursor-based pagination.

The CLI can poll this endpoint to stream logs incrementally:
1. First call: no cursor
2. Subsequent calls: cursor=next_cursor from the previous response
3. Stop polling when the deployment reaches a terminal status



## OpenAPI

````yaml https://api.dev-sgp.scale.com/openapi-versions/v5/openapi.json get /v5/agentex/deployments/{deployment_id}/logs
openapi: 3.1.0
info:
  title: EGP API V5
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
paths:
  /v5/agentex/deployments/{deployment_id}/logs:
    get:
      tags:
        - Agentex Cloud Deploy
      summary: Get Deployment Logs
      description: |-
        Get structured log lines for a deployment with cursor-based pagination.

        The CLI can poll this endpoint to stream logs incrementally:
        1. First call: no cursor
        2. Subsequent calls: cursor=next_cursor from the previous response
        3. Stop polling when the deployment reaches a terminal status
      operationId: GET-V5-/agentex/deployments/deployment_id/logs
      parameters:
        - name: deployment_id
          in: path
          required: true
          schema:
            type: string
            title: Deployment Id
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            description: Cursor from previous response's next_cursor field
            default: ''
            title: Cursor
          description: Cursor from previous response's next_cursor field
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 500
            minimum: 1
            description: Maximum number of log lines to return
            default: 100
            title: Limit
          description: Maximum number of log lines to return
        - name: x-selected-account-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account ID Header
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentexCloudDeployLogsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    AgentexCloudDeployLogsResponse:
      properties:
        deployment_id:
          type: string
          title: Deployment Id
          description: The deployment ID
        lines:
          items:
            $ref: '#/components/schemas/AgentexCloudDeployLog'
          type: array
          title: Lines
          description: Structured log lines
        next_cursor:
          type: string
          title: Next Cursor
          description: >-
            Cursor for the next page. Pass this as the after_id query parameter
            to get subsequent logs.
          default: ''
        has_more:
          type: boolean
          title: Has More
          description: >-
            True if there may be more lines beyond this page (len(lines) ==
            limit).
      type: object
      required:
        - deployment_id
        - has_more
      title: AgentexCloudDeployLogsResponse
      description: >-
        Response containing structured deployment log lines with cursor-based
        pagination.


        The CLI can poll this endpoint to stream logs incrementally:

        1. First call: no after_id

        2. Subsequent calls: after_id=next_cursor from previous response

        3. Stop polling when has_more is False and the deployment reaches a
        terminal status
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentexCloudDeployLog:
      properties:
        id:
          type: string
          title: Id
          description: Unique log line identifier (time-ordered)
        timestamp:
          title: Timestamp
          description: Parsed K8s log timestamp
          type: string
          format: date-time
        log_level:
          type: string
          title: Log Level
          description: Parsed log level (INFO, ERROR, WARN, DEBUG, FATAL)
          default: INFO
        message:
          type: string
          title: Message
          description: Log line content after the K8s timestamp
      type: object
      required:
        - id
        - message
      title: AgentexCloudDeployLog
      description: A single structured log line from the deployment process.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          title: Error Type
          type: string
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````