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

# Get platform-wide metrics for admin dashboards (Admin only)

> Returns aggregated metrics across all organizations including:
- Total users and organizations
- Total requests and revenue
- Top models by usage
- Top organizations by spend



## OpenAPI

````yaml /api-reference/openapi.json get /v1/admin/platform/metrics
openapi: 3.1.0
info:
  title: NEAR AI Cloud API
  description: >-
    NEAR AI Cloud API for private AI model inference and organization
    administration.
  contact:
    name: NEAR AI Team
    email: support@near.ai
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://cloud-api.near.ai
    description: NEAR AI Cloud
security:
  - session_token: []
  - api_key: []
tags:
  - name: Chat
    description: Chat completion endpoints for AI model inference
  - name: Images
    description: Image generation endpoints
  - name: Audio
    description: Audio transcription endpoints
  - name: Rerank
    description: Document reranking endpoints
  - name: Score
    description: Text similarity scoring endpoints
  - name: Privacy
    description: Privacy classification (PII span detection) endpoints
  - name: Models
    description: Public model catalog and information
  - name: Responses
    description: >-
      Stateless response inference (`store: false` only). Raw request/response
      content, response items, and history are not persisted. Clients must
      include any prior context in each request. Every successful Responses
      inference makes exactly one Chat Completions call. Only custom `function`
      tools are supported. They are client-managed: Cloud returns
      `function_call` items but never executes them; a later `store: false`
      request replays the individual call (the raw item from output is accepted)
      with its matching `function_call_output`, alongside caller-managed message
      history and the same function tool definitions. The minimal replay path
      also accepts assistant `message` text parts of type `output_text`, but not
      reasoning or arbitrary full `response.output` items. Server-executed tools
      (`web_search`, `web_context_search`, `file_search`, `code_interpreter`,
      `computer`, and remote `mcp`) and image-generation/editing models are
      rejected. The separate `POST /mcp` endpoint continues to expose its
      `web_search` tool independently of Responses; use `/v1/images/*` for image
      generation/editing. Existing completed-response gateway attestation is
      preserved best-effort: when the signature write succeeds, `GET
      /v1/signature/resp_*` retrieves signatures over SHA-256 request/response
      digests, never raw content. Interrupted streams create no `resp_*`
      attestation record or legacy disconnect fallback. Conversations, response
      history, and file input are rejected.
  - name: Organizations
    description: Organization management
  - name: Organization Members
    description: Organization member and invitation management
  - name: Workspaces
    description: Workspace and API key management
  - name: Users
    description: User profile and token management
  - name: Invitations
    description: Token-based invitation handling
  - name: Usage
    description: Usage tracking and billing information
  - name: Reporting
    description: Read-only customer usage reporting
  - name: Billing
    description: Billing costs endpoint (HuggingFace integration)
  - name: Staking Farm
    description: House of Stake farm credit configuration and synchronization
  - name: Health
    description: Health check endpoints
  - name: Attestation
    description: Attestation and verification endpoints
  - name: Gateway
    description: Model gateway integration endpoints
  - name: Admin
    description: Administrative endpoints (admin access required)
  - name: Services
    description: Public platform services (e.g. web_search pricing)
paths:
  /v1/admin/platform/metrics:
    get:
      tags:
        - Admin
      summary: Get platform-wide metrics for admin dashboards (Admin only)
      description: |-
        Returns aggregated metrics across all organizations including:
        - Total users and organizations
        - Total requests and revenue
        - Top models by usage
        - Top organizations by spend
      operationId: get_platform_metrics
      parameters:
        - name: start
          in: query
          description: Start of time range (ISO 8601). Defaults to 30 days ago.
          required: false
          schema:
            type: string
        - name: end
          in: query
          description: End of time range (ISO 8601). Defaults to now.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Platform metrics retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformMetrics'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - session_token: []
components:
  schemas:
    PlatformMetrics:
      type: object
      description: Platform-wide metrics for admin dashboard
      required:
        - period_start
        - period_end
        - generated_at
        - total_users
        - total_organizations
        - total_requests
        - total_consumed_usd
        - total_tokens
        - total_cache_read_tokens
        - new_users
        - new_organizations
        - active_organizations
        - paying_organizations
        - verifiable_consumed_usd
        - verifiable_requests
        - non_verifiable_consumed_usd
        - non_verifiable_requests
        - provider_error_or_timeout_rate
        - provider_usage
        - top_models
        - top_organizations
      properties:
        active_organizations:
          type: integer
          format: int64
          description: Organizations that issued ≥1 request in the period
        generated_at:
          type: string
          format: date-time
          description: >-
            When this response was computed. The
            `total_users`/`total_organizations`/

            `paying_organizations` fields are **current snapshots as of this
            time**, not

            period-bound like the rest.
        new_organizations:
          type: integer
          format: int64
          description: Organizations created in the period
        new_users:
          type: integer
          format: int64
          description: Users created in the period
        non_verifiable_consumed_usd:
          type: number
          format: double
          description: >-
            Consumed cost on non-verifiable models, USD (NOT necessarily
            third-party)
        non_verifiable_requests:
          type: integer
          format: int64
        p95_ttft_ms:
          type:
            - number
            - 'null'
          format: double
          description: 95th percentile time-to-first-token across the platform (ms)
        paying_organizations:
          type: integer
          format: int64
          description: >-
            Snapshot (as of `generated_at`): orgs with an active payment-type
            credit.

            NOTE: does not yet count postpaid/invoiced customers (see #704).
        period_end:
          type: string
          format: date-time
        period_start:
          type: string
          format: date-time
        provider_error_or_timeout_rate:
          type: number
          format: double
          description: >-
            Share of requests whose stop_reason ∈ {provider_error, timeout},
            0.0–1.0
        provider_usage:
          $ref: '#/components/schemas/PlatformProviderUsage'
        top_models:
          type: array
          items:
            $ref: '#/components/schemas/TopModelMetrics'
        top_organizations:
          type: array
          items:
            $ref: '#/components/schemas/TopOrganizationMetrics'
        total_cache_read_tokens:
          type: integer
          format: int64
        total_consumed_usd:
          type: number
          format: double
          description: >-
            Total **consumed usage cost** in USD over the period (inference
            only).

            NOT recognized revenue: grant/payment funding is not separable
            without

            per-request attribution (tracked in #704).
        total_organizations:
          type: integer
          format: int64
          description: Snapshot (as of `generated_at`).
        total_requests:
          type: integer
          format: int64
        total_tokens:
          type: integer
          format: int64
        total_users:
          type: integer
          format: int64
          description: Snapshot (as of `generated_at`).
        verifiable_consumed_usd:
          type: number
          format: double
          description: Consumed cost on verifiable (TEE-attested) models, USD
        verifiable_requests:
          type: integer
          format: int64
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
    PlatformProviderUsage:
      type: object
      required:
        - fallback
        - non_fallback
        - by_provider_type
        - by_provider_tier
      properties:
        by_provider_tier:
          type: array
          items:
            $ref: '#/components/schemas/ProviderTierUsage'
        by_provider_type:
          type: array
          items:
            $ref: '#/components/schemas/ProviderTypeUsage'
        fallback:
          $ref: '#/components/schemas/ProviderUsageTotals'
        non_fallback:
          $ref: '#/components/schemas/ProviderUsageTotals'
    TopModelMetrics:
      type: object
      description: Top model by request count
      required:
        - model_name
        - requests
        - revenue_usd
      properties:
        model_name:
          type: string
        requests:
          type: integer
          format: int64
        revenue_usd:
          type: number
          format: double
    TopOrganizationMetrics:
      type: object
      description: Top organization by spend
      required:
        - organization_id
        - organization_name
        - requests
        - spend_usd
      properties:
        organization_id:
          type: string
          format: uuid
        organization_name:
          type: string
        requests:
          type: integer
          format: int64
        spend_usd:
          type: number
          format: double
    ErrorDetail:
      type: object
      required:
        - message
        - type
      properties:
        code:
          type:
            - string
            - 'null'
        message:
          type: string
        param:
          type:
            - string
            - 'null'
        type:
          type: string
    ProviderTierUsage:
      type: object
      required:
        - requests
        - input_tokens
        - output_tokens
        - total_tokens
        - cache_read_tokens
        - consumed_cost_usd
      properties:
        cache_read_tokens:
          type: integer
          format: int64
        consumed_cost_usd:
          type: number
          format: double
        input_tokens:
          type: integer
          format: int64
        output_tokens:
          type: integer
          format: int64
        provider_tier:
          type:
            - string
            - 'null'
        requests:
          type: integer
          format: int64
        total_tokens:
          type: integer
          format: int64
    ProviderTypeUsage:
      type: object
      required:
        - requests
        - input_tokens
        - output_tokens
        - total_tokens
        - cache_read_tokens
        - consumed_cost_usd
      properties:
        cache_read_tokens:
          type: integer
          format: int64
        consumed_cost_usd:
          type: number
          format: double
        input_tokens:
          type: integer
          format: int64
        output_tokens:
          type: integer
          format: int64
        provider_type:
          type:
            - string
            - 'null'
        requests:
          type: integer
          format: int64
        total_tokens:
          type: integer
          format: int64
    ProviderUsageTotals:
      type: object
      required:
        - requests
        - input_tokens
        - output_tokens
        - total_tokens
        - cache_read_tokens
        - consumed_cost_usd
      properties:
        cache_read_tokens:
          type: integer
          format: int64
        consumed_cost_usd:
          type: number
          format: double
        input_tokens:
          type: integer
          format: int64
        output_tokens:
          type: integer
          format: int64
        requests:
          type: integer
          format: int64
        total_tokens:
          type: integer
          format: int64
  securitySchemes:
    session_token:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT access token for user authentication (Authorization: Bearer
        <jwt_token>). Create via POST /users/me/access_tokens.
    api_key:
      type: http
      scheme: bearer
      bearerFormat: api_key
      description: 'API key for programmatic access (Authorization: Bearer sk-<api_key>)'

````

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