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

# List logs

> Lists paginated request logs for a workspace. Date range is constrained by the
workspace plan's log retention period.

For image operations, both generations and edits are included when filtering by image routes.



## OpenAPI

````yaml /spec/ai-logs.yaml get /v1/workspaces/{workspaceID}/logs
openapi: 3.0.1
info:
  title: AI - Logs
  description: >-
    Request logs for AI workspace inference operations. Logs track chat
    completions,

    embeddings, and image operations with usage and cost details.


    Parameters:

    - `teamID`: To access services in a team (query param or `x-teamid` header)


    Authentication: JWT Bearer token (for management) or API Key (for API key
    auth).
  termsOfService: '#'
  contact:
    email: info@liara.ir
  version: 1.0.0
servers:
  - url: https://ai.liara.ir
security:
  - jwt: []
tags:
  - name: Logs
    description: Request logs for inference operations
externalDocs:
  description: Find out more about Liara AI
  url: https://liara.ir
paths:
  /v1/workspaces/{workspaceID}/logs:
    get:
      tags:
        - Logs
      summary: List logs
      description: >-
        Lists paginated request logs for a workspace. Date range is constrained
        by the

        workspace plan's log retention period.


        For image operations, both generations and edits are included when
        filtering by image routes.
      operationId: listLogs
      parameters:
        - name: workspaceID
          in: path
          required: true
          description: The workspace ID
          schema:
            type: string
            pattern: ^[a-f0-9]{24}$
        - name: from
          in: query
          description: 'Start date (default: 1 day ago, constrained by plan log retention)'
          schema:
            type: string
            format: date
        - name: to
          in: query
          description: 'End date (default: now)'
          schema:
            type: string
            format: date
        - name: model
          in: query
          description: Filter by model ID
          schema:
            type: string
        - name: url
          in: query
          description: Filter by route
          schema:
            type: string
            enum:
              - /chat/completions
              - /embeddings
              - /image/generations
              - /image/edits
            default: /chat/completions
        - name: page
          in: query
          description: Page number
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: count
          in: query
          description: Items per page
          schema:
            type: integer
            minimum: 1
            default: 15
        - name: key
          in: query
          description: Filter by API key name
          schema:
            type: string
            minLength: 3
            maxLength: 15
      responses:
        '200':
          description: Paginated list of logs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LogListResponse'
        '401':
          description: Missing authentication
          content: {}
        '404':
          description: Workspace not found
          content: {}
        '416':
          description: Date range exceeds plan retention
          content: {}
components:
  schemas:
    LogListResponse:
      type: object
      properties:
        logs:
          type: array
          items:
            $ref: '#/components/schemas/LogEntry'
        count:
          type: integer
          description: Total number of matching logs
    LogEntry:
      type: object
      properties:
        _id:
          type: string
        type:
          type: string
          enum:
            - ERROR_VALIDATION
            - PROVIDER_RESPONSE
            - ERROR_PROVIDER
        content:
          type: object
          properties:
            model:
              type: string
            key:
              type: string
              description: API key name
            details:
              type: object
              properties:
                tokens_prompt:
                  type: integer
                tokens_completion:
                  type: integer
                total_cost_toman:
                  type: number
        workspace:
          type: string
        method:
          type: string
        url:
          type: string
        createdAt:
          type: string
          format: date-time
  securitySchemes:
    jwt:
      type: apiKey
      description: 'Enter the token with the `Bearer: ` prefix, e.g. "Bearer abcde12345"'
      name: Authorization
      in: header

````