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

# List gateway request logs

> Returns paginated request metadata for one gateway. Request and response bodies are not included. Requires gateways:read-logs.



## OpenAPI

````yaml /api-reference/openapi.json get /gateways/{id}/logs
openapi: 3.0.0
info:
  title: AIRCTRL API
  description: >-
    Programmatic access to AIRCTRL. Record values are encrypted by the client,
    so the API stores ciphertext and encrypted keys instead of plaintext record
    values.
  version: '1'
  contact: {}
servers:
  - url: https://api.airctrl.dev/v1
    description: Production
security: []
tags:
  - name: Context
    description: Find the accounts available to the caller.
  - name: Projects
    description: Create and manage projects.
  - name: Records
    description: Store and use client-encrypted records.
  - name: Audit
    description: Read record activity and access history.
  - name: Providers
    description: Discover supported AI providers.
  - name: Provider Credentials
    description: Manage encrypted provider credentials.
  - name: Gateways
    description: Create and operate AI gateways.
  - name: Usage
    description: Read gateway usage and spend data.
  - name: Service Accounts
    description: Read Service Account metadata and grant records.
paths:
  /gateways/{id}/logs:
    get:
      tags:
        - Gateways
      summary: List gateway request logs
      description: >-
        Returns paginated request metadata for one gateway. Request and response
        bodies are not included. Requires gateways:read-logs.
      operationId: GatewaysController_listLogs
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Gateway request logs.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                  data:
                    $ref: '#/components/schemas/GatewayLogs'
                required:
                  - ok
                  - data
                additionalProperties: false
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - personal-access-token: []
        - service-account-token: []
components:
  schemas:
    GatewayLogs:
      type: object
      properties:
        rows:
          type: array
          items:
            $ref: '#/components/schemas/GatewayRequestLog'
        total:
          type: integer
          minimum: 0
        facets:
          type: object
          properties:
            providers:
              type: array
              items:
                type: object
                properties:
                  slug:
                    type: string
                  count:
                    type: integer
                    minimum: 0
                additionalProperties: false
                required:
                  - slug
                  - count
            statusClasses:
              type: array
              items:
                type: object
                properties:
                  class:
                    type: string
                  count:
                    type: integer
                    minimum: 0
                additionalProperties: false
                required:
                  - class
                  - count
          additionalProperties: false
          required:
            - providers
            - statusClasses
        can_read_spend:
          type: boolean
        can_read_bodies:
          type: boolean
      additionalProperties: false
      required:
        - rows
        - total
        - facets
        - can_read_spend
        - can_read_bodies
    GatewayRequestLog:
      type: object
      properties:
        log_id:
          type: string
          format: uuid
        provider_slug:
          type: string
          nullable: true
        model:
          type: string
          nullable: true
        status_code:
          type: integer
          nullable: true
        streamed:
          type: boolean
        prompt_tokens:
          type: integer
          nullable: true
        completion_tokens:
          type: integer
          nullable: true
        total_tokens:
          type: integer
          nullable: true
        cost:
          type: string
          nullable: true
        cost_estimated:
          type: boolean
        cache_hit:
          type: boolean
        latency_ms:
          type: integer
          nullable: true
        error_code:
          type: string
          nullable: true
        finish_reason:
          type: string
          nullable: true
        upstream_request_id:
          type: string
          nullable: true
        claude_session_id:
          type: string
          nullable: true
        token_name:
          type: string
          nullable: true
        principal_type:
          type: string
          enum:
            - user
            - service_account
          nullable: true
        service_account_name:
          type: string
          nullable: true
        owner_email:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
      additionalProperties: false
      required:
        - log_id
        - provider_slug
        - model
        - status_code
        - streamed
        - prompt_tokens
        - completion_tokens
        - total_tokens
        - cost
        - cost_estimated
        - cache_hit
        - latency_ms
        - error_code
        - finish_reason
        - upstream_request_id
        - claude_session_id
        - token_name
        - principal_type
        - service_account_name
        - owner_email
        - created_at
    ErrorEnvelope:
      type: object
      properties:
        ok:
          type: boolean
          enum:
            - false
        error:
          type: object
          properties:
            code:
              type: string
              description: Stable error category.
            message:
              type: string
              description: Plain-language reason for the failure.
            details:
              description: Optional validation or error details.
          additionalProperties: false
          required:
            - code
            - message
        requestId:
          type: string
          description: Request identifier to include when contacting support.
      additionalProperties: false
      required:
        - ok
        - error
      description: Standard AIRCTRL error response.
  responses:
    Unauthorized:
      description: >-
        The token is missing, invalid, expired or cannot authenticate this
        request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            ok: false
            error:
              code: unauthorized
              message: Authentication is required
            requestId: req_example
    Forbidden:
      description: >-
        The authenticated principal does not have the required permission or
        resource access.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            ok: false
            error:
              code: forbidden
              message: not_authorized
            requestId: req_example
    RateLimited:
      description: The caller exceeded the API request limit. Wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            ok: false
            error:
              code: rate_limited
              message: Too many requests
            requestId: req_example
    InternalError:
      description: >-
        AIRCTRL could not complete the request. Retry later and keep the request
        ID for support.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            ok: false
            error:
              code: internal_error
              message: Internal server error
            requestId: req_example
  securitySchemes:
    personal-access-token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Human personal access token (`sk-actrl-pat-...`).
    service-account-token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Service Account token (`sk-actrl-sa-...`).

````