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

# How an agent's model requests were routed

> The agent's model requests over the window, from telemetry: how many
a fallback served, how many every provider failed (``exhausted``), per
provider connection the requests it served and its failed attempts
(``position`` 0 = the primary, 1..3 = its fallback position now, null =
no longer in the route), and the failure classes the runtime moved on
for. ``available: false`` with zeros when telemetry cannot be read.



## OpenAPI

````yaml https://cp.xenovia.io/openapi.json get /api/v1/agents/{agent_id}/routing-stats
openapi: 3.1.0
info:
  title: Xenovia Control Plane API
  version: 1.0.0
  description: >-
    Management API for agents, providers, policies, telemetry, alerts and
    organization settings.
servers:
  - url: https://cp.xenovia.io
    description: Production
security:
  - BearerAuth: []
paths:
  /api/v1/agents/{agent_id}/routing-stats:
    get:
      tags:
        - agents
      summary: How an agent's model requests were routed
      description: |-
        The agent's model requests over the window, from telemetry: how many
        a fallback served, how many every provider failed (``exhausted``), per
        provider connection the requests it served and its failed attempts
        (``position`` 0 = the primary, 1..3 = its fallback position now, null =
        no longer in the route), and the failure classes the runtime moved on
        for. ``available: false`` with zeros when telemetry cannot be read.
      operationId: get_routing_stats_route_api_v1_agents__agent_id__routing_stats_get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Agent Id
        - name: window
          in: query
          required: false
          schema:
            enum:
              - 1h
              - 24h
              - 7d
            type: string
            description: 1h, 24h or 7d
            default: 24h
            title: Window
          description: 1h, 24h or 7d
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRoutingStats'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AgentRoutingStats:
      properties:
        window:
          type: string
          enum:
            - 1h
            - 24h
            - 7d
          title: Window
        available:
          type: boolean
          title: Available
          default: true
        requests:
          type: integer
          title: Requests
          default: 0
        served_by_fallback:
          type: integer
          title: Served By Fallback
          default: 0
        fallback_rate:
          type: number
          title: Fallback Rate
          default: 0
        exhausted:
          type: integer
          title: Exhausted
          default: 0
        by_provider:
          items:
            $ref: '#/components/schemas/RoutingStatsProvider'
          type: array
          title: By Provider
        reasons:
          items:
            $ref: '#/components/schemas/RoutingStatsReason'
          type: array
          title: Reasons
      type: object
      required:
        - window
      title: AgentRoutingStats
      description: |-
        GET /agents/{agent_id}/routing-stats: an agent's model requests over
        a window, from telemetry. ``available`` is false (and every number zero)
        when the telemetry store cannot be read.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RoutingStatsProvider:
      properties:
        provider_id:
          type: string
          format: uuid
          title: Provider Id
        position:
          anyOf:
            - type: integer
            - type: 'null'
          title: Position
        served:
          type: integer
          title: Served
        failed_attempts:
          type: integer
          title: Failed Attempts
      type: object
      required:
        - provider_id
        - position
        - served
        - failed_attempts
      title: RoutingStatsProvider
    RoutingStatsReason:
      properties:
        reason:
          type: string
          title: Reason
        count:
          type: integer
          title: Count
      type: object
      required:
        - reason
        - count
      title: RoutingStatsReason
    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:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token: an organization API key (`ak_…`) created under Settings →
        API Keys, or a dashboard user session token. Agent keys (`xe_…`) are not
        accepted here. Endpoints marked as user-only in their description reject
        organization keys with `403`.

````

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