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

# Summarize organization usage and costs.

> Requires a reporting token scoped to the organization in the path. Totals
include inference and platform service usage by default.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/organizations/{org_id}/usage/summary
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/organizations/{org_id}/usage/summary:
    get:
      tags:
        - Reporting
      summary: Summarize organization usage and costs.
      description: >-
        Requires a reporting token scoped to the organization in the path.
        Totals

        include inference and platform service usage by default.
      operationId: summary_usage
      parameters:
        - name: org_id
          in: path
          description: Organization ID
          required: true
          schema:
            type: string
            format: uuid
        - name: start_time
          in: query
          description: >-
            Inclusive RFC3339 start timestamp. Defaults to 366 days before the
            effective end_time.
          required: false
          schema:
            type: string
        - name: end_time
          in: query
          description: >-
            Inclusive RFC3339 end timestamp. Defaults to the request time. The
            effective range must not exceed 366 days.
          required: false
          schema:
            type: string
        - name: source
          in: query
          description: Usage source to summarize. Defaults to all.
          required: false
          schema:
            $ref: '#/components/schemas/ReportingUsageSource'
        - name: workspace_id
          in: query
          description: Filter by workspace ID.
          required: false
          schema:
            type: string
            format: uuid
        - name: api_key_id
          in: query
          description: Filter by API key ID.
          required: false
          schema:
            type: string
            format: uuid
        - name: model
          in: query
          description: Filter inference usage by model name.
          required: false
          schema:
            type: string
        - name: inference_type
          in: query
          description: Filter inference usage by inference type.
          required: false
          schema:
            type: string
        - name: service_name
          in: query
          description: Filter service usage by platform service name.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Usage summary
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportingUsageSummaryResponse'
        '400':
          description: Invalid filters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Reporting token is not scoped to this organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Reporting rate or concurrency limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Reporting request timed out
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - reporting_token: []
components:
  schemas:
    ReportingUsageSource:
      type: string
      enum:
        - all
        - inference
        - service
    ReportingUsageSummaryResponse:
      type: object
      required:
        - source
        - start_time
        - end_time
        - totals
        - by_workspace
        - by_api_key
        - by_model
        - by_service
        - by_day
      properties:
        by_api_key:
          type: array
          items:
            $ref: '#/components/schemas/ReportingApiKeySummary'
        by_day:
          type: array
          items:
            $ref: '#/components/schemas/ReportingDaySummary'
        by_model:
          type: array
          items:
            $ref: '#/components/schemas/ReportingModelSummary'
        by_service:
          type: array
          items:
            $ref: '#/components/schemas/ReportingServiceSummary'
        by_workspace:
          type: array
          items:
            $ref: '#/components/schemas/ReportingWorkspaceSummary'
        end_time:
          type: string
          format: date-time
        source:
          $ref: '#/components/schemas/ReportingUsageSource'
        start_time:
          type: string
          format: date-time
        totals:
          $ref: '#/components/schemas/ReportingUsageTotals'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
    ReportingApiKeySummary:
      type: object
      required:
        - api_key_id
        - request_count
        - service_usage_count
        - total_cost_nano_usd
      properties:
        api_key_id:
          type: string
          format: uuid
        request_count:
          type: integer
          format: int64
        service_usage_count:
          type: integer
          format: int64
        total_cost_nano_usd:
          type: integer
          format: int64
    ReportingDaySummary:
      type: object
      required:
        - day
        - request_count
        - service_usage_count
        - input_tokens
        - output_tokens
        - cache_read_tokens
        - total_tokens
        - inference_cost_nano_usd
        - service_cost_nano_usd
        - total_cost_nano_usd
      properties:
        cache_read_tokens:
          type: integer
          format: int64
        day:
          type: string
        inference_cost_nano_usd:
          type: integer
          format: int64
        input_tokens:
          type: integer
          format: int64
        output_tokens:
          type: integer
          format: int64
        request_count:
          type: integer
          format: int64
        service_cost_nano_usd:
          type: integer
          format: int64
        service_usage_count:
          type: integer
          format: int64
        total_cost_nano_usd:
          type: integer
          format: int64
        total_tokens:
          type: integer
          format: int64
    ReportingModelSummary:
      type: object
      required:
        - model
        - request_count
        - input_tokens
        - output_tokens
        - cache_read_tokens
        - total_tokens
        - total_cost_nano_usd
      properties:
        cache_read_tokens:
          type: integer
          format: int64
        input_tokens:
          type: integer
          format: int64
        model:
          type: string
        output_tokens:
          type: integer
          format: int64
        request_count:
          type: integer
          format: int64
        total_cost_nano_usd:
          type: integer
          format: int64
        total_tokens:
          type: integer
          format: int64
    ReportingServiceSummary:
      type: object
      required:
        - service_name
        - usage_count
        - quantity
        - total_cost_nano_usd
      properties:
        quantity:
          type: integer
          format: int64
        service_name:
          type: string
        total_cost_nano_usd:
          type: integer
          format: int64
        usage_count:
          type: integer
          format: int64
    ReportingWorkspaceSummary:
      type: object
      required:
        - workspace_id
        - request_count
        - service_usage_count
        - total_cost_nano_usd
      properties:
        request_count:
          type: integer
          format: int64
        service_usage_count:
          type: integer
          format: int64
        total_cost_nano_usd:
          type: integer
          format: int64
        workspace_id:
          type: string
          format: uuid
    ReportingUsageTotals:
      type: object
      required:
        - request_count
        - service_usage_count
        - input_tokens
        - output_tokens
        - cache_read_tokens
        - total_tokens
        - inference_cost_nano_usd
        - service_cost_nano_usd
        - total_cost_nano_usd
      properties:
        cache_read_tokens:
          type: integer
          format: int64
        inference_cost_nano_usd:
          type: integer
          format: int64
        input_tokens:
          type: integer
          format: int64
        output_tokens:
          type: integer
          format: int64
        request_count:
          type: integer
          format: int64
        service_cost_nano_usd:
          type: integer
          format: int64
        service_usage_count:
          type: integer
          format: int64
        total_cost_nano_usd:
          type: integer
          format: int64
        total_cost_usd:
          type:
            - string
            - 'null'
        total_tokens:
          type: integer
          format: int64
    ErrorDetail:
      type: object
      required:
        - message
        - type
      properties:
        code:
          type:
            - string
            - 'null'
        message:
          type: string
        param:
          type:
            - string
            - 'null'
        type:
          type: string
  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>)'
    reporting_token:
      type: http
      scheme: bearer
      bearerFormat: reporting_token
      description: >-
        Read-only reporting token for usage reporting endpoints (Authorization:
        Bearer rpt-<reporting_token>)

````

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