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

# Get the FinOps dashboard

> Cost and token rows per agent, plus a fleet-wide summary.



## OpenAPI

````yaml /api-reference/openapi.json get /api/observability/finops/dashboard
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:
  - url: https://free.app.nasiko.com
    description: Nasiko Cloud Free
  - url: https://{workspace}.app.nasiko.com
    description: Nasiko Cloud paid workspace
    variables:
      workspace:
        default: your-workspace
        description: >-
          Your workspace's subdomain, as shown in the connect command on the
          dashboard's Nasiko CLI page
security:
  - bearer_auth: []
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: context-selection
    description: >-
      Per-user chat-history selection preferences: strategy, PACMS budget tier,
      the on/off switch, a dry-run preview, and settings-change history
  - name: coding-agents
    description: >-
      The progress local clients report while they bring in the caller's coding
      agents
  - name: settings
    description: >-
      Workspace-wide settings, including the Optimization tiers a user's PACMS
      budget level resolves against
  - 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/dashboard:
    get:
      tags:
        - observability
      summary: Get the FinOps dashboard
      description: Cost and token rows per agent, plus a fleet-wide summary.
      operationId: get_finops_dashboard
      parameters:
        - name: start_time
          in: query
          description: >-
            ISO-8601 window start (default: 30 days ago). Ignored when `range`
            is set.
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: end_time
          in: query
          description: >-
            ISO-8601 window end (default: now). Without it a past-month
            selection

            means "that month through today" rather than that month.
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: range
          in: query
          description: '"24h" | "7d" | "30d" — quick-select range, overrides `start_time`.'
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: agent_id
          in: query
          description: Agent UUID or name — scopes the whole response to one agent.
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: model
          in: query
          description: Exact model id, matched against span model attributes.
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: provider
          in: query
          description: Provider name filter (e.g. "openai", "anthropic").
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: org_unit
          in: query
          description: >-
            Org-unit filter (Enterprise). Open-source servers accept it and
            ignore it.
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: view
          in: query
          description: >-
            "agent" | "workflow" — which attribution source powers the
            response's

            `attributions` field (default "agent").
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: my_agent
          in: query
          description: |-
            When `true`, restricts results to agents owned by the caller.
            Ignored when `agent_id` is also set (already scoped to one agent).
          required: false
          schema:
            type: boolean
        - name: compare
          in: query
          description: >-
            `previous` adds the preceding window of the same length to the same

            response, so a caller comparing two windows needs one request, not
            two.

            Anything else is ignored.
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: group_by
          in: query
          description: >-
            `agent` (spend-timeseries only) adds a per-agent series for the top

            spenders plus an `other` aggregate, replacing one filtered request
            per

            driver. Any other value is a 400.
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: top
          in: query
          description: |-
            How many agents get their own series under `group_by=agent`
            (default 5, clamped 1-20). The rest fold into `other`.
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int64
        - name: user_id
          in: query
          description: >-
            One user's usage only (a user UUID). An admin may name anyone;
            anyone else only

            themselves (403 otherwise).
          required: false
          schema:
            type:
              - string
              - 'null'
      responses:
        '200':
          description: FinOps dashboard data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinopsDashboardResponse'
        '400':
          description: Malformed filter (range/view/agent_id)
        '401':
          description: Missing or invalid session
components:
  schemas:
    FinopsDashboardResponse:
      type: object
      required:
        - data
        - status_code
        - message
      properties:
        data:
          $ref: '#/components/schemas/FinopsDashboardData'
        message:
          type: string
        status_code:
          type: integer
          format: int32
          minimum: 0
    FinopsDashboardData:
      type: object
      required:
        - summary
        - agents
        - token_usage
        - kpis
        - attributions
        - spend_by_agent
        - users
      properties:
        agents:
          type: array
          items:
            $ref: '#/components/schemas/AgentFinopsRow'
        attributions:
          $ref: '#/components/schemas/FinopsAttributions'
        kpis:
          $ref: '#/components/schemas/FinopsKpis'
        spend_by_agent:
          $ref: '#/components/schemas/SpendByAgentBreakdown'
          description: >-
            Pre-computed spend split for the selected window: top-5 agents by
            spend

            plus an "Others" catchall, ready to feed a pie/donut chart without
            any

            client-side aggregation.
        summary:
          $ref: '#/components/schemas/FinopsSummary'
        token_usage:
          $ref: '#/components/schemas/FinopsTokenUsage'
        users:
          type: array
          items:
            $ref: '#/components/schemas/UserFinopsRow'
          description: >-
            Spend per user in the window, largest spender first, with the same
            filters as the rest of the dashboard. A caller who may not see other
            users gets only their own row.
    AgentFinopsRow:
      type: object
      required:
        - agent_id
        - agent_name
        - total_cost
        - operations
        - is_capped
        - avg_cost_per_operation
        - prompt_tokens
        - completion_tokens
        - cache_read_tokens
        - cache_creation_tokens
        - total_tokens
        - tool_call_count
        - container_hours
        - sandbox_minutes
      properties:
        agent_id:
          type: string
        agent_name:
          type: string
        avg_cost_per_operation:
          type: number
          format: double
        avg_latency_ms:
          type:
            - number
            - 'null'
          format: double
          description: p50 trace-level latency for this agent in the window.
        avg_latency_p95_ms:
          type:
            - number
            - 'null'
          format: double
        avg_latency_p99_ms:
          type:
            - number
            - 'null'
          format: double
        cache_creation_tokens:
          type: integer
          format: int64
          description: Prompt tokens written to provider cache (Anthropic cache creation).
          minimum: 0
        cache_read_tokens:
          type: integer
          format: int64
          description: >-
            Prompt tokens served from provider cache (OpenAI cached / Anthropic
            cache read).
          minimum: 0
        completion_tokens:
          type: integer
          format: int64
          minimum: 0
        container_hours:
          type: number
          format: double
          description: Replica-hours this agent consumed in the dashboard window.
        is_capped:
          type: boolean
          description: |-
            True when `operations` was capped by the token-aggregation trace
            limit — the token/cost fields below undercount the real total.
        operations:
          type: integer
          minimum: 0
        previous:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/AgentFinopsPrevious'
              description: >-
                This agent's figures for the preceding window of the same
                length, present

                only with `compare=previous`.


                The previous window is already queried on every dashboard call
                (the KPI

                strip's `change_pct` needs it) and was simply discarded per
                agent, so a

                caller that wanted per-agent comparison had to issue a second
                whole

                dashboard request for the earlier window. Omitted by default so
                the

                default payload is byte-identical to before.
        prompt_tokens:
          type: integer
          format: int64
          minimum: 0
        sandbox_minutes:
          type: number
          format: double
          description: Sandbox-minutes this agent consumed in the dashboard window.
        tool_call_count:
          type: integer
          format: int64
          minimum: 0
        total_cost:
          type: number
          format: double
        total_tokens:
          type: integer
          format: int64
          minimum: 0
        version:
          type:
            - string
            - 'null'
    FinopsAttributions:
      oneOf:
        - type: object
          required:
            - rows
            - view
          properties:
            rows:
              type: array
              items:
                $ref: '#/components/schemas/AgentFinopsRow'
            view:
              type: string
              enum:
                - agent
        - type: object
          required:
            - rows
            - view
          properties:
            rows:
              type: array
              items:
                $ref: '#/components/schemas/WorkflowFinopsRow'
            view:
              type: string
              enum:
                - workflow
    FinopsKpis:
      type: object
      required:
        - total_spend
        - total_tokens
        - cost_per_operation
        - avg_latency_ms
        - total_agents
        - active_agents
        - total_operations
        - total_tool_calls
        - latency_p95_ms
        - latency_p99_ms
      properties:
        active_agents:
          $ref: '#/components/schemas/KpiValue'
        avg_latency_ms:
          $ref: '#/components/schemas/KpiValue'
          description: Fleet-wide p50 latency (label kept for UI backward compat).
        cost_per_operation:
          $ref: '#/components/schemas/KpiValue'
        latency_p95_ms:
          $ref: '#/components/schemas/KpiValue'
        latency_p99_ms:
          $ref: '#/components/schemas/KpiValue'
        total_agents:
          $ref: '#/components/schemas/KpiValue'
        total_operations:
          $ref: '#/components/schemas/KpiValue'
        total_spend:
          $ref: '#/components/schemas/KpiValue'
        total_tokens:
          $ref: '#/components/schemas/KpiValue'
        total_tool_calls:
          $ref: '#/components/schemas/KpiValue'
    SpendByAgentBreakdown:
      type: object
      required:
        - slices
        - total_spend_usd
      properties:
        slices:
          type: array
          items:
            $ref: '#/components/schemas/SpendPieSlice'
          description: |-
            Top-5 agents by spend, followed by an "Others" entry when there are
            more than 5 agents. Empty when there is no spend in the window.
        total_spend_usd:
          type: number
          format: double
    FinopsSummary:
      type: object
      required:
        - total_cost
        - total_operations
        - operations_last_24h
        - average_cost
        - active_agents
        - total_agents
        - total_container_hours
        - total_sandbox_minutes
        - unpriced_calls
        - estimated_cost
        - unknown_confidence_calls
      properties:
        active_agents:
          type: integer
          minimum: 0
        average_cost:
          type: number
          format: double
        estimated_cost:
          type: number
          format: double
          description: >-
            Sum of rows explicitly priced using inferred rates or usage
            evidence.
        operations_last_24h:
          type: integer
          minimum: 0
        total_agents:
          type: integer
          minimum: 0
        total_container_hours:
          type: number
          format: double
          description: >-
            Replica-hours consumed in the dashboard window — includes agents
            that

            have since been deleted (their sessions survive deletion).
        total_cost:
          type: number
          format: double
        total_operations:
          type: integer
          minimum: 0
        total_sandbox_minutes:
          type: number
          format: double
          description: >-
            Sandbox-minutes (Running time) consumed in the dashboard window,
            deleted agents

            included. Container-hours carry no price here, so sandbox time is
            reported in minutes

            only and is not part of `total_cost`. `finops/insights` does not
            carry it: that endpoint

            only relays client-supplied figures to the model.
        unknown_confidence_calls:
          type: integer
          description: Older materializations without recorded pricing confidence.
          minimum: 0
        unpriced_calls:
          type: integer
          description: >-
            Calls in the window that consumed tokens with no price row for the
            model

            (e.g. a custom provider with no price book): they carry no cost, or
            a cost

            at the default rate (`metadata.pricing.source = 'Default'`). Either
            way

            `total_cost` is not a looked-up figure for them; this surfaces the
            gap as a

            known number.
          minimum: 0
    FinopsTokenUsage:
      type: object
      required:
        - total_tokens
        - prompt_tokens
        - completion_tokens
        - cache_read_tokens
        - cache_creation_tokens
        - avg_tokens_per_operation
      properties:
        avg_tokens_per_operation:
          type: integer
          format: int64
          minimum: 0
        cache_creation_tokens:
          type: integer
          format: int64
          description: Prompt tokens written to provider cache (Anthropic cache creation).
          minimum: 0
        cache_read_tokens:
          type: integer
          format: int64
          description: >-
            Prompt tokens served from provider cache (OpenAI cached / Anthropic
            cache read).
          minimum: 0
        completion_tokens:
          type: integer
          format: int64
          minimum: 0
        prompt_tokens:
          type: integer
          format: int64
          minimum: 0
        total_tokens:
          type: integer
          format: int64
          minimum: 0
    UserFinopsRow:
      type: object
      description: One user's usage in the dashboard window.
      required:
        - total_cost
        - operations
        - prompt_tokens
        - completion_tokens
        - cache_read_tokens
        - cache_creation_tokens
        - total_tokens
        - tool_call_count
        - agents
      properties:
        agents:
          type: integer
          format: int64
          description: How many agents the user's calls went to.
        cache_creation_tokens:
          type: integer
          format: int64
        cache_read_tokens:
          type: integer
          format: int64
        completion_tokens:
          type: integer
          format: int64
        email:
          type:
            - string
            - 'null'
        operations:
          type: integer
          format: int64
        prompt_tokens:
          type: integer
          format: int64
        tool_call_count:
          type: integer
          format: int64
        total_cost:
          type: number
          format: double
        total_tokens:
          type: integer
          format: int64
          description: >-
            Prompt, completion and both cache counts, as the dashboard's
            `token_usage` counts them.
        user_id:
          type:
            - string
            - 'null'
          description: >-
            `None` for calls no user made: the platform's own routing and
            planning.
        username:
          type:
            - string
            - 'null'
    AgentFinopsPrevious:
      type: object
      description: >-
        One agent's preceding-window totals. Deliberately a subset: enough to
        compute

        a delta, not a second full row.
      required:
        - total_cost
        - operations
        - total_tokens
        - tool_call_count
      properties:
        avg_latency_ms:
          type:
            - number
            - 'null'
          format: double
        operations:
          type: integer
          minimum: 0
        tool_call_count:
          type: integer
          format: int64
          minimum: 0
        total_cost:
          type: number
          format: double
        total_tokens:
          type: integer
          format: int64
          minimum: 0
    WorkflowFinopsRow:
      type: object
      required:
        - maf_id
        - workflow_name
        - total_cost
        - executions
        - avg_cost_per_execution
        - prompt_tokens
        - completion_tokens
        - cache_read_tokens
        - cache_creation_tokens
        - total_tokens
      properties:
        avg_cost_per_execution:
          type: number
          format: double
        avg_latency_ms:
          type:
            - number
            - 'null'
          format: double
        cache_creation_tokens:
          type: integer
          format: int64
          description: Prompt tokens written to provider cache (Anthropic cache creation).
          minimum: 0
        cache_read_tokens:
          type: integer
          format: int64
          description: >-
            Prompt tokens served from provider cache (OpenAI cached / Anthropic
            cache read).
          minimum: 0
        completion_tokens:
          type: integer
          format: int64
          minimum: 0
        executions:
          type: integer
          minimum: 0
        maf_id:
          type: string
        prompt_tokens:
          type: integer
          format: int64
          minimum: 0
        total_cost:
          type: number
          format: double
        total_tokens:
          type: integer
          format: int64
          minimum: 0
        workflow_name:
          type: string
    KpiValue:
      type: object
      required:
        - current
        - previous
      properties:
        change_pct:
          type:
            - number
            - 'null'
          format: double
          description: |-
            `(current - previous) / previous * 100`, rounded to 2dp. `None` when
            `previous == 0` — an undefined percentage, not a fabricated 0 or ∞.
        current:
          type: number
          format: double
        previous:
          type: number
          format: double
    SpendPieSlice:
      type: object
      required:
        - agent_name
        - spend_usd
        - pct
      properties:
        agent_name:
          type: string
        pct:
          type: number
          format: double
          description: Percentage of total window spend, rounded to 2dp.
        spend_usd:
          type: number
          format: double
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Session JWT. After `nasiko auth login`, print it with `jq -r
        '.clusters[.active].token' ~/.nasiko/config.json`. API keys aren't
        supported.

````

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