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

# List Api Keys Via Edge Function

> List all API keys for the authenticated user (via Edge Function)

Returns all API keys (active and revoked) created by the user,
along with counts showing usage against the limit.

Security:
- Only callable by edge functions (validated via shared secret)
- Edge function validates user's JWT on Supabase side

Headers (from edge function):
    X-Edge-Secret: Shared secret
    X-User-Id: Supabase user ID (already validated)
    X-User-Email: User email (already validated)
    
Returns:
    ListAPIKeysResponse with keys list and counts (total, active, max)



## OpenAPI

````yaml openapi.json get /v2/auth/api-keys
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/api-keys:
    get:
      tags:
        - Authentication
      summary: List Api Keys Via Edge Function
      description: |-
        List all API keys for the authenticated user (via Edge Function)

        Returns all API keys (active and revoked) created by the user,
        along with counts showing usage against the limit.

        Security:
        - Only callable by edge functions (validated via shared secret)
        - Edge function validates user's JWT on Supabase side

        Headers (from edge function):
            X-Edge-Secret: Shared secret
            X-User-Id: Supabase user ID (already validated)
            X-User-Email: User email (already validated)
            
        Returns:
            ListAPIKeysResponse with keys list and counts (total, active, max)
      operationId: list_api_keys_via_edge_function_v2_auth_api_keys
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAPIKeysResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ListAPIKeysResponse:
      properties:
        keys:
          items:
            $ref: '#/components/schemas/APIKeyResponse'
          type: array
          title: Keys
        total_count:
          type: integer
          title: Total Count
          description: Total number of keys for this user
        active_count:
          type: integer
          title: Active Count
          description: Number of active keys
        max_keys:
          type: integer
          title: Max Keys
          description: Maximum allowed keys per user
      type: object
      required:
        - keys
        - total_count
        - active_count
        - max_keys
      title: ListAPIKeysResponse
      description: Response for listing API keys with count
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    APIKeyResponse:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        public_prefix:
          type: string
          title: Public Prefix
        is_active:
          type: boolean
          title: Is Active
        created_at:
          type: string
          format: date-time
          title: Created At
        last_used_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Used At
        revoked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Revoked At
      type: object
      required:
        - id
        - name
        - public_prefix
        - is_active
        - created_at
        - last_used_at
        - revoked_at
      title: APIKeyResponse
      description: API key information (without secret)
    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

````