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

# Get User Usage

> Get current usage and quota information for the authenticated user

Returns detailed usage metrics including:
- API request counts by service (evaluation, security audit, red team, tracing, scanner)
- Token usage by service
- Quota limits and remaining quota
- Current billing period information

This endpoint is designed for frontend dashboards to display usage stats.

Authentication:
    Requires valid API key in Authorization header
    
Returns:
    UserUsageResponse with complete usage breakdown



## OpenAPI

````yaml openapi.json get /v2/auth/usage
openapi: 3.1.0
info:
  title: Valiqor API
  description: >-
    The Valiqor API provides programmatic access to AI application testing,
    evaluation, failure analysis, and security auditing.


    ## Authentication


    All API requests require an API key passed as a Bearer token in the
    `Authorization` header:


    ```

    Authorization: Bearer vq-xxxxxxxxxxxxxxxxxxxx

    ```


    Get your API key from the [Valiqor Dashboard](https://app.valiqor.com) or
    via `valiqor login` CLI command.


    ## Base URL


    ```

    https://api.valiqor.com

    ```
  version: 2.0.0
  contact:
    name: Valiqor Support
    url: https://valiqor.com
    email: support@valiqor.com
servers:
  - url: https://api.valiqor.com
    description: Production
security: []
tags:
  - name: Authentication
    description: >-
      API key validation, user management, device authorization flow, and CLI
      authentication. All SDK requests require a valid API key passed as a
      Bearer token.
  - name: Evaluation
    description: >-
      Run quality evaluations on datasets or traces. Compute metrics like
      faithfulness, relevance, coherence, and more. Compare runs and track
      trends over time.
  - name: Security
    description: >-
      Security audits (S1-S23 safety categories) and red team simulations.
      Detect prompt injection, harmful content, data leakage, and other
      vulnerabilities.
  - name: Failure Analysis
    description: >-
      Analyze AI app failures with root cause detection, severity scoring, and
      actionable fix suggestions. Supports both trace-based (full) and
      dataset-based (minimal) analysis modes.
  - name: Tracing
    description: >-
      Upload and query execution traces from AI applications. Traces capture
      messages, spans, tool calls, retrievals, and LLM interactions for
      debugging and evaluation.
  - name: Scanner
    description: >-
      Upload code scans to detect AI app features, workflows, and prompts.
      Generates evaluation configurations automatically from your codebase.
  - name: Projects
    description: >-
      Create and manage projects. Projects are containers that organize
      evaluation runs, security audits, traces, and failure analysis results.
paths:
  /v2/auth/usage:
    get:
      tags:
        - Authentication
      summary: Get User Usage
      description: >-
        Get current usage and quota information for the authenticated user


        Returns detailed usage metrics including:

        - API request counts by service (evaluation, security audit, red team,
        tracing, scanner)

        - Token usage by service

        - Quota limits and remaining quota

        - Current billing period information


        This endpoint is designed for frontend dashboards to display usage
        stats.


        Authentication:
            Requires valid API key in Authorization header
            
        Returns:
            UserUsageResponse with complete usage breakdown
      operationId: get_user_usage_v2_auth_usage
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserUsageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyAuth: []
components:
  schemas:
    UserUsageResponse:
      properties:
        total_api_usage:
          type: integer
          title: Total Api Usage
        evaluation_usage:
          type: integer
          title: Evaluation Usage
        security_audit_usage:
          type: integer
          title: Security Audit Usage
        security_redteam_usage:
          type: integer
          title: Security Redteam Usage
        tracing_usage:
          type: integer
          title: Tracing Usage
        scanner_usage:
          type: integer
          title: Scanner Usage
        failure_analysis_usage:
          type: integer
          title: Failure Analysis Usage
          default: 0
        total_token_usage:
          type: integer
          title: Total Token Usage
        evaluation_tokens:
          type: integer
          title: Evaluation Tokens
        security_audit_tokens:
          type: integer
          title: Security Audit Tokens
        security_redteam_tokens:
          type: integer
          title: Security Redteam Tokens
        tracing_tokens:
          type: integer
          title: Tracing Tokens
        scanner_tokens:
          type: integer
          title: Scanner Tokens
        failure_analysis_tokens:
          type: integer
          title: Failure Analysis Tokens
          default: 0
        api_quota_limit:
          type: integer
          title: Api Quota Limit
        token_quota_limit:
          type: integer
          title: Token Quota Limit
        api_quota_remaining:
          type: integer
          title: Api Quota Remaining
        token_quota_remaining:
          type: integer
          title: Token Quota Remaining
        period_start:
          type: string
          title: Period Start
        period_end:
          type: string
          title: Period End
        reset_date:
          type: string
          title: Reset Date
        org_id:
          type: string
          title: Org Id
        org_name:
          type: string
          title: Org Name
        plan:
          type: string
          title: Plan
      type: object
      required:
        - total_api_usage
        - evaluation_usage
        - security_audit_usage
        - security_redteam_usage
        - tracing_usage
        - scanner_usage
        - total_token_usage
        - evaluation_tokens
        - security_audit_tokens
        - security_redteam_tokens
        - tracing_tokens
        - scanner_tokens
        - api_quota_limit
        - token_quota_limit
        - api_quota_remaining
        - token_quota_remaining
        - period_start
        - period_end
        - reset_date
        - org_id
        - org_name
        - plan
      title: UserUsageResponse
      description: User usage and quota information for frontend display
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Valiqor API key. Pass as Bearer token: `Authorization: Bearer
        vq-xxxxxxxxxxxxxxxxxxxx`

````