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

# Windowed replica-hours per agent (billing source of truth), optionally bucketed.



## OpenAPI

````yaml /api-reference/openapi.json get /api/observability/finops/agent-hours
openapi: 3.1.0
info:
  title: Nasiko API
  description: >-
    HTTP API for the Nasiko OpenRuntime: agents, coding harnesses, TokenOps,
    routing, MCP, and secrets. Spec is generated from annotated routes; some
    surfaces are documented on the hand-written pages alongside this file.
  license:
    name: ''
  version: 0.1.0
servers: []
security: []
tags:
  - name: secrets
    description: Encrypted per-user agent secrets
  - name: catalog
    description: >-
      Agent catalog: registration, discovery, versions, per-agent secrets, and
      source import
  - name: agents
    description: >-
      Agent lifecycle: deployments, LLM routing config, update/rollback,
      upload-and-deploy
  - name: orchestrator
    description: >-
      A2A dispatch: routing-engine/ReAct orchestrator and direct agent chat,
      plus routing stats
  - name: users
    description: >-
      User management: CRUD, roles, credentials, accessible agents
      (superuser-only)
  - name: usage
    description: Per-user token usage and cost reporting
  - name: observability
    description: Sessions, traces, spans, agent logs, and FinOps reporting
  - name: llm-router
    description: LLM routing presets, provider/model catalog, and tier→model registry
  - name: mcp
    description: >-
      MCP gateway: agent-facing JSON-RPC tool calls, connector
      registration/upload/sharing, credentials & OAuth, and per-agent tool
      permissions
paths:
  /api/observability/finops/agent-hours:
    get:
      tags:
        - observability
      summary: >-
        Windowed replica-hours per agent (billing source of truth), optionally
        bucketed.
      operationId: get_agent_hours
      parameters:
        - name: start_time
          in: query
          description: >-
            ISO-8601 window start (default: all-time; 30 days ago when `bucket`
            is set).
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: end_time
          in: query
          description: 'ISO-8601 window end (default: now).'
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: agent_id
          in: query
          description: Optional agent UUID — restricts the report to one agent.
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: bucket
          in: query
          description: >-
            Optional series granularity: "hour" | "day". Anything else is
            ignored.
          required: false
          schema:
            type:
              - string
              - 'null'
      responses:
        '200':
          description: Replica-hours report
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentHoursResponse'
        '400':
          description: Malformed start_time/end_time/agent_id
components:
  schemas:
    AgentHoursResponse:
      type: object
      required:
        - data
        - status_code
        - message
      properties:
        data:
          $ref: '#/components/schemas/AgentHoursData'
        message:
          type: string
        status_code:
          type: integer
          format: int32
          minimum: 0
    AgentHoursData:
      type: object
      required:
        - total_hours
        - window
        - agents
      properties:
        agents:
          type: array
          items:
            $ref: '#/components/schemas/AgentHoursRow'
          description: >-
            Sessions-derived rows — includes agents that have since been
            deleted.
        buckets:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/AgentHoursBucket'
          description: Time series, present only when the `bucket` query param is set.
        total_hours:
          type: number
          format: double
          description: Replica-hours across all listed agents within the window.
        window:
          $ref: '#/components/schemas/AgentHoursWindow'
    AgentHoursRow:
      type: object
      required:
        - agent_id
        - agent_name
        - hours
        - live_replicas
        - deleted
      properties:
        agent_id:
          type: string
        agent_name:
          type: string
        deleted:
          type: boolean
        hours:
          type: number
          format: double
        live_replicas:
          type: integer
          format: int64
          description: >-
            Replicas live right now among the sessions that overlapped this
            window.
    AgentHoursBucket:
      type: object
      required:
        - start
        - total_hours
        - agents
      properties:
        agents:
          type: array
          items:
            $ref: '#/components/schemas/AgentHoursBucketAgent'
          description: Per-agent breakdown for this bucket (only agents with hours in it).
        start:
          type: string
        total_hours:
          type: number
          format: double
    AgentHoursWindow:
      type: object
      required:
        - start
        - end
      properties:
        end:
          type: string
        start:
          type: string
    AgentHoursBucketAgent:
      type: object
      required:
        - agent_id
        - agent_name
        - hours
        - deleted
      properties:
        agent_id:
          type: string
        agent_name:
          type: string
        deleted:
          type: boolean
        hours:
          type: number
          format: double

````