ai&

ai& Logs API

The logs API from ai& — 4 operation(s) for logs.

Operations 6

GET /logs List request logs #
DELETE /logs Delete stored request content #
GET /logs/settings Read content-logging setting #
PATCH /logs/settings Update content-logging setting #
GET /logs/export Export stored request content #
GET /logs/{id} Retrieve one request with its content #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/aiand-com:aiand-com-logs-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

aiand-com-logs-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: ai& Logs API
  version: 1.0.0
  description: Unified spec covering inference, files, and other public surfaces. Drop-in compatible with OpenAI and Anthropic SDKs.
servers:
- url: https://api.aiand.com
  description: ai& API
security:
- bearerAuth: []
tags:
- name: Logs
paths:
  /logs:
    get:
      operationId: listRequestLogs
      tags:
      - Logs
      summary: List request logs
      description: Per-request rows for your organization, newest first, cursor-paginated. Authenticate with an API key, or a console JWT plus `X-Org-ID`.
      security:
      - bearerAuth: []
      parameters:
      - in: query
        name: range
        schema:
          type: string
          enum:
          - 15m
          - 1h
          - 6h
          - 24h
          - 7days
          - 30days
        description: Look-back window. Default `24h`.
      - in: query
        name: errors
        schema:
          type: boolean
        description: Only non-2xx requests.
      - in: query
        name: endpoint
        schema:
          type: string
        description: Only requests to this `/v1` path, e.g. `/v1/responses`.
      - in: query
        name: content_logged
        schema:
          type: boolean
        description: Only requests where capture was attempted (see content_logged). The page is then ordered by `request_at`.
      - in: query
        name: limit
        schema:
          type: integer
          minimum: 1
          maximum: 100
        description: Page size. Default 50.
      - in: query
        name: after
        schema:
          type: string
        description: 'Cursor: `next_after` from the previous page, passed back unchanged. Requires `after_id`; either alone is a 400.'
      - in: query
        name: after_id
        schema:
          type: string
        description: 'Cursor: `next_after_id` from the previous page. Requires `after`.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: The request's X-Request-ID.
                        model:
                          type:
                          - string
                          - 'null'
                        api_key:
                          type:
                          - string
                          - 'null'
                          example: sk-...abcd
                        status_code:
                          type:
                          - integer
                          - 'null'
                        ttft_ms:
                          type:
                          - integer
                          - 'null'
                        latency_ms:
                          type:
                          - integer
                          - 'null'
                        input_tokens:
                          type:
                          - integer
                          - 'null'
                        output_tokens:
                          type:
                          - integer
                          - 'null'
                        cached_tokens:
                          type:
                          - integer
                          - 'null'
                        cost:
                          type: string
                          example: '0.00420000'
                          description: Denominated in `currency`.
                        currency:
                          type: string
                          example: usd
                        created_at:
                          type: string
                          example: '2026-05-18 12:34:56.123456+00'
                          description: When billing settled the row.
                        request_at:
                          type: string
                          example: '2026-05-18 12:34:56.123456+00'
                          description: When the request was received.
                        endpoint:
                          type:
                          - string
                          - 'null'
                          example: /v1/chat/completions
                        content_logged:
                          type: boolean
                          description: Whether capture was attempted for this request, not a storage-success guarantee. A rare miss shows as `unavailable` in GET /logs/{id}, never as false here.
                      required:
                      - id
                      - model
                      - api_key
                      - status_code
                      - ttft_ms
                      - latency_ms
                      - input_tokens
                      - output_tokens
                      - cached_tokens
                      - cost
                      - currency
                      - created_at
                      - request_at
                      - endpoint
                      - content_logged
                  has_more:
                    type: boolean
                  next_after:
                    type:
                    - string
                    - 'null'
                  next_after_id:
                    type:
                    - string
                    - 'null'
                required:
                - data
                - has_more
                - next_after
                - next_after_id
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
    delete:
      operationId: deleteRequestLogContent
      tags:
      - Logs
      summary: Delete stored request content
      description: Organization admins only. Starts deleting every stored request and response body for your organization; the purge finishes in the background. Metadata rows are kept. The logging switch is untouched, so with logging on, later requests are captured again. Authenticate with an API key, or a console JWT plus `X-Org-ID`.
      security:
      - bearerAuth: []
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  accepted:
                    type: boolean
                    const: true
                required:
                - accepted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
  /logs/settings:
    get:
      operationId: getRequestLogSettings
      tags:
      - Logs
      summary: Read content-logging setting
      description: Whether content logging is available and switched on for your organization. Reflects a PATCH immediately; capture itself follows within about a minute. Turning logging off does not delete existing content. Authenticate with an API key, or a console JWT plus `X-Org-ID`.
      security:
      - bearerAuth: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  log_content_enabled:
                    type: boolean
                  available:
                    type: boolean
                    description: Whether request-content capture can be switched on for your organization. Hide capture controls when false.
                  data_retention:
                    type: string
                    enum:
                    - standard
                    - zero
                    description: '`zero` when your organization is on zero data retention: content logging is unavailable and cannot be switched on.'
                required:
                - log_content_enabled
                - available
                - data_retention
        '401':
          $ref: '#/components/responses/Unauthorized'
    patch:
      operationId: updateRequestLogSettings
      tags:
      - Logs
      summary: Update content-logging setting
      description: Organization admins only. Takes up to about a minute to apply everywhere. Turning logging off does not delete existing content. Returns `404` where content capture is unavailable in this environment; otherwise an organization on zero data retention that turns logging on is refused with `403 zero_data_retention`. Authenticate with an API key, or a console JWT plus `X-Org-ID`.
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - log_content_enabled
              properties:
                log_content_enabled:
                  type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  log_content_enabled:
                    type: boolean
                  available:
                    type: boolean
                    description: Whether request-content capture can be switched on for your organization. Hide capture controls when false.
                  data_retention:
                    type: string
                    enum:
                    - standard
                    - zero
                    description: '`zero` when your organization is on zero data retention: content logging is unavailable and cannot be switched on.'
                required:
                - log_content_enabled
                - available
                - data_retention
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
  /logs/export:
    get:
      operationId: exportRequestLogContent
      tags:
      - Logs
      summary: Export stored request content
      description: 'Organization admins only. Downloads the stored request and response bodies of the logged requests in a window as gzip-compressed JSON Lines, newest first: one line per request, in the shape of `content` on GET /logs/{id}. One file holds the newest 5,000 requests in the window at most; page through older ones with GET /logs and GET /logs/{id}. Authenticate with an API key, or a console JWT plus `X-Org-ID`.'
      security:
      - bearerAuth: []
      parameters:
      - in: query
        name: range
        schema:
          type: string
          enum:
          - 15m
          - 1h
          - 6h
          - 24h
          - 7days
          - 30days
        description: Look-back window. Default `24h`.
      - in: query
        name: errors
        schema:
          type: boolean
        description: Only non-2xx requests.
      - in: query
        name: endpoint
        schema:
          type: string
        description: Only requests to this `/v1` path, e.g. `/v1/responses`.
      responses:
        '200':
          description: OK
          content:
            application/gzip:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
  /logs/{id}:
    get:
      operationId: getRequestLog
      tags:
      - Logs
      summary: Retrieve one request with its content
      description: Metadata plus captured content, whichever exist, with a `state` explaining any missing part. 404 only when neither exists. Authenticate with an API key, or a console JWT plus `X-Org-ID`.
      security:
      - bearerAuth: []
      parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
        description: The `X-Request-ID` returned on the original response.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  state:
                    type: string
                    enum:
                    - ready
                    - processing
                    - not_logged
                    - expired
                    - unavailable
                  metadata:
                    type:
                    - object
                    - 'null'
                    properties:
                      model:
                        type:
                        - string
                        - 'null'
                      api_key:
                        type:
                        - string
                        - 'null'
                        example: sk-...abcd
                      status_code:
                        type:
                        - integer
                        - 'null'
                      ttft_ms:
                        type:
                        - integer
                        - 'null'
                      latency_ms:
                        type:
                        - integer
                        - 'null'
                      input_tokens:
                        type:
                        - integer
                        - 'null'
                      output_tokens:
                        type:
                        - integer
                        - 'null'
                      cached_tokens:
                        type:
                        - integer
                        - 'null'
                      cost:
                        type: string
                        example: '0.00420000'
                        description: Denominated in `currency`.
                      currency:
                        type: string
                        example: usd
                      created_at:
                        type: string
                        example: '2026-05-18 12:34:56.123456+00'
                        description: When billing settled the row.
                      request_at:
                        type: string
                        example: '2026-05-18 12:34:56.123456+00'
                        description: When the request was received.
                      endpoint:
                        type:
                        - string
                        - 'null'
                        example: /v1/chat/completions
                    required:
                    - model
                    - api_key
                    - status_code
                    - ttft_ms
                    - latency_ms
                    - input_tokens
                    - output_tokens
                    - cached_tokens
                    - cost
                    - currency
                    - created_at
                    - request_at
                    - endpoint
                  content:
                    type:
                    - object
                    - 'null'
                    properties:
                      endpoint:
                        type: string
                      streamed:
                        type: boolean
                      capturedAt:
                        type: string
                      requestId:
                        type: string
                      responseId:
                        type:
                        - string
                        - 'null'
                      request:
                        type: string
                        description: The request body as JSON text. Inline base64 media is replaced by `omitted:<media-type>;bytes=<n>`.
                      response:
                        type: string
                        description: 'The response as text: JSON for a non-streamed response, the raw event stream for a streamed one. Exactly what was returned to you.'
                      error:
                        type:
                        - object
                        - 'null'
                        properties:
                          status:
                            type: integer
                          message:
                            type: string
                        required:
                        - status
                        - message
                        description: 'For a failed request: the message you received and the upstream status when there was one.'
                      truncated:
                        type: boolean
                    required:
                    - endpoint
                    - streamed
                    - capturedAt
                    - requestId
                    - responseId
                    - request
                    - response
                    - error
                    - truncated
                required:
                - id
                - state
                - metadata
                - content
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    const: not_found
                required:
                - error
components:
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            param:
              type: string
            code:
              type: string
          required:
          - message
          - type
      required:
      - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Authorization: Bearer <API_KEY>'