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

# How a Data API is used

> Totals for anyone who can see the API; per consumer for its owner and admins.



## OpenAPI

````yaml get /api/data-apis/{name}/usage
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/data-apis/{name}/usage:
    get:
      tags:
        - Data APIs
      summary: How a Data API is used
      description: >-
        Totals for anyone who can see the API; per consumer for its owner and
        admins.
      operationId: data_api_usage_api_data_apis__name__usage_get
      parameters:
        - name: name
          in: path
          required: true
          schema:
            type: string
            pattern: ^[a-z][a-z0-9_]{1,62}$
            description: The API's name.
            title: Name
          description: The API's name.
        - name: days
          in: query
          required: false
          schema:
            type: integer
            maximum: 90
            minimum: 1
            default: 7
            title: Days
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataApiUsageResponse'
        '400':
          description: Invalid request.
        '403':
          description: Not allowed.
        '404':
          description: No such API or version.
        '409':
          description: Conflicts with the API's state.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too many of your queries are running; see Retry-After.
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    DataApiUsageResponse:
      properties:
        days:
          type: integer
          title: Days
        calls:
          type: integer
          title: Calls
        errors:
          type: integer
          title: Errors
        consumers:
          type: integer
          title: Consumers
        by_consumer:
          items:
            $ref: '#/components/schemas/ConsumerUsage'
          type: array
          title: By Consumer
          description: Only for the API's owner and admins; empty otherwise.
      type: object
      required:
        - days
        - calls
        - errors
        - consumers
      title: DataApiUsageResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ConsumerUsage:
      properties:
        consumer:
          type: string
          title: Consumer
        calls:
          type: integer
          title: Calls
        errors:
          type: integer
          title: Errors
        p95_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: P95 Ms
        last_called_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Called At
        last_context_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Context Hash
        current_context:
          type: boolean
          title: Current Context
          default: false
      type: object
      required:
        - consumer
        - calls
        - errors
      title: ConsumerUsage
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.