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

# Record API key usage



## OpenAPI

````yaml post /api/v1/api-key/record-usage
openapi: 3.0.0
info:
  title: Oneloop API
  version: 1.0.0
  description: API Key Management
servers:
  - url: https://prod.oneloop.ai
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/v1/api-key/record-usage:
    post:
      summary: Record API key usage
      operationId: recordApiKeyUsage
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecordUsageApiKeyRequest'
      responses:
        '200':
          description: The record usage result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecordUsageApiKeyResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    RecordUsageApiKeyRequest:
      type: object
      properties:
        key:
          type: string
        usage:
          type: string
          pattern: ^\d+$
          default: '0'
        usageName:
          type: string
      required:
        - key
    RecordUsageApiKeyResponse:
      type: object
      properties: {}
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: number
              minimum: 0
              exclusiveMinimum: true
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````