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

# Get LLM logs

> Lists LLM request logs for the authenticated team within a time window. Optional `mdlx_user_id` filters by the end-user id sent as `X-Mdlx-User-Id` on inference. Uses the query rate limit (separate from inference RPM).



## OpenAPI

````yaml /llm/api/llm.json get /logs
openapi: 3.1.0
info:
  title: Modellix LLM API
  description: >-
    Public API of the Modellix LLM gateway: OpenAI-compatible Chat Completions
    and Responses, Anthropic-compatible Messages, plus model listing and request
    logs.


    Optional fields follow the corresponding official protocols; this document
    lists commonly used core fields only.
  version: '2026-08-07'
  contact:
    name: Modellix
servers:
  - url: https://llm.modellix.ai/v1
    description: Production
security:
  - BearerAuth: []
  - ApiKeyAuth: []
tags:
  - name: Chat Completions
    description: OpenAI-compatible Chat Completions
  - name: Responses
    description: OpenAI-compatible Responses
  - name: Messages
    description: Anthropic-compatible Messages
  - name: Models
    description: List available models
  - name: Logs
    description: List team request logs
paths:
  /logs:
    get:
      tags:
        - Logs
      summary: Get LLM logs
      description: >-
        Lists LLM request logs for the authenticated team within a time window.
        Optional `mdlx_user_id` filters by the end-user id sent as
        `X-Mdlx-User-Id` on inference. Uses the query rate limit (separate from
        inference RPM).
      operationId: listRequestLogs
      parameters:
        - name: start_time
          in: query
          required: true
          description: Window start (UNIX seconds)
          schema:
            type: integer
            minimum: 1
            example: 1700000000
        - name: end_time
          in: query
          required: true
          description: >-
            Window end (UNIX seconds). Must be greater than start_time; span ≤
            30 days.
          schema:
            type: integer
            minimum: 1
            example: 1700086400
        - name: mdlx_user_id
          in: query
          required: false
          description: Exact match filter; same rules as X-Mdlx-User-Id.
          schema:
            type: string
            minLength: 8
            maxLength: 128
            pattern: ^[A-Za-z0-9_-]+$
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
      responses:
        '200':
          description: Paginated request logs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestLogsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '502':
          $ref: '#/components/responses/UpstreamError'
components:
  schemas:
    RequestLogsResponse:
      type: object
      required:
        - requests
        - total
        - page
        - page_size
      properties:
        requests:
          type: array
          items:
            $ref: '#/components/schemas/RequestLogItem'
        total:
          type: integer
        page:
          type: integer
        page_size:
          type: integer
    RequestLogItem:
      type: object
      properties:
        task_id:
          type: string
        apikeyname:
          type: string
        model:
          $ref: '#/components/schemas/RequestLogModel'
        status:
          type: string
        error:
          type: string
        result: {}
        input: {}
        created_at:
          type: integer
        duration:
          type: integer
        prompt_tokens:
          type: integer
        completion_tokens:
          type: integer
        cached_tokens:
          type: integer
        cost:
          type: integer
          description: >-
            Billed amount in sub-pennies (1 = USD $0.0001). Same unit as Console
            balance; divide by 10000 for dollars. 0 if not charged.
        latency_sec:
          type: number
        e2e_sec:
          type: number
        tps:
          type: number
        client_ip:
          type: string
    ErrorBody:
      type: object
      required:
        - error
      description: >-
        Gateway error envelope shared by Chat Completions, Responses, and
        Messages.
      properties:
        error:
          type: object
          required:
            - message
            - type
          additionalProperties: true
          description: Error details object.
          properties:
            message:
              type: string
              description: Human-readable error message.
            type:
              type: string
              description: >-
                Error type string (for example invalid_request_error,
                rate_limit_exceeded, insufficient_quota).
              examples:
                - invalid_request_error
                - api_error
                - rate_limit_exceeded
                - request_limited
                - insufficient_quota
            code:
              type:
                - string
                - 'null'
              description: Optional machine-readable error code, or null.
            param:
              type:
                - string
                - 'null'
              description: Optional parameter name related to the error, or null.
    RequestLogModel:
      type: object
      properties:
        provider:
          type: string
        model_name:
          type: string
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
    Unauthorized:
      description: >-
        Missing or invalid API key, or conflicting Authorization and x-api-key
        values
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          example:
            error:
              message: invalid API key
              type: invalid_request_error
    RateLimited:
      description: >-
        Rate limited (RPM or other request limits), or the selected model is
        temporarily unavailable (e.g. upstream deployment cooldown)
      headers:
        X-RateLimit-Limit:
          description: Maximum number of requests allowed in the current rate-limit window.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Number of requests remaining in the current rate-limit window.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: Unix timestamp (seconds) when the current rate-limit window resets.
          schema:
            type: integer
        Retry-After:
          schema:
            type: integer
          description: >-
            May be returned when the model is temporarily unavailable; value in
            seconds
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          examples:
            rpm:
              summary: RPM exceeded
              value:
                error:
                  message: rate limit exceeded
                  type: rate_limit_exceeded
            modelCooldown:
              summary: Model temporarily unavailable
              value:
                error:
                  message: >-
                    the selected model is temporarily unavailable, please retry
                    later or try another model
                  type: api_error
    UpstreamError:
      description: >-
        Temporary service unavailability or upstream error (client-facing
        message may be sanitized)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Authorization: Bearer <Modellix API Key> (OpenAI SDK, Codex, OpenCode,
        etc.)
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        x-api-key: <Modellix API Key> (Anthropic SDK, Claude Code, etc.).
        Equivalent to Bearer; if both are present they must be the same key.

````