> ## 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.

# Verify a key for a given workspace



## OpenAPI

````yaml post /api/v1/api-key/verify
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/verify:
    post:
      summary: Verify a key for a given workspace
      operationId: verifyApiKey
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyApiKeyRequest'
      responses:
        '200':
          description: The verification result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerifyApiKeyResponse'
        '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:
    VerifyApiKeyRequest:
      type: object
      properties:
        key:
          type: string
        requestedScopes:
          type: array
          items:
            $ref: '#/components/schemas/ApiKeyScope'
        route:
          type: string
        billing:
          type: object
          properties:
            usage:
              type: string
              pattern: ^\d+$
              default: '0'
            usageName:
              type: string
        rateLimitConfig:
          type: object
          properties:
            id:
              type: string
            limit:
              type: integer
              minimum: 0
              exclusiveMinimum: true
          required:
            - id
            - limit
      required:
        - key
        - requestedScopes
    VerifyApiKeyResponse:
      type: object
      properties:
        apiKeyId:
          type: string
        expiresAt:
          type: integer
          nullable: true
          minimum: 0
          exclusiveMinimum: true
        requestedScopes:
          type: array
          items:
            $ref: '#/components/schemas/ApiKeyScope'
        status:
          type: string
          enum:
            - VALID
            - EXPIRED
            - DISABLED
            - DELETED
            - RATE_LIMITED
            - USAGE_LIMITED
            - INVALID_SCOPES
            - INVALID
        rateLimit:
          type: object
          properties:
            remaining:
              type: integer
            resetAt:
              type: integer
          required:
            - remaining
            - resetAt
        metadata:
          type: object
          additionalProperties:
            type: string
        billing:
          $ref: '#/components/schemas/CustomerBillingMeter'
        externalMeterId:
          type: string
          nullable: true
        customerId:
          type: string
          nullable: true
        scopes:
          type: array
          items:
            $ref: '#/components/schemas/ApiKeyScope'
      required:
        - apiKeyId
        - expiresAt
        - requestedScopes
        - status
        - billing
        - externalMeterId
        - customerId
        - scopes
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: number
              minimum: 0
              exclusiveMinimum: true
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
    ApiKeyScope:
      type: object
      properties:
        id:
          type: string
        representation:
          type: string
        create:
          type: boolean
        read:
          type: boolean
        update:
          type: boolean
        del:
          type: boolean
      required:
        - representation
        - create
        - read
        - update
        - del
    CustomerBillingMeter:
      type: object
      nullable: true
      properties:
        id:
          type: string
        totalCredits:
          type: string
          pattern: ^d+$
        usedCredits:
          type: string
          pattern: ^d+$
        allowOverages:
          type: boolean
        spendCap:
          type: string
          nullable: true
          pattern: ^d+$
        createdAt:
          type: string
        updatedAt:
          type: string
      required:
        - id
        - totalCredits
        - usedCredits
        - allowOverages
        - spendCap
        - createdAt
        - updatedAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````