> ## 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 coding-agent usage



## OpenAPI

````yaml /api-reference/openapi.json get /api/observability/coding-agents/usage
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/coding-agents/usage:
    get:
      tags:
        - observability
      summary: Get coding-agent usage
      operationId: get_coding_agent_usage
      parameters:
        - name: scope
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: unit_id
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: user_id
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: group_by
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: range
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: start_time
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: end_time
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: compare
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: cursor
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: limit
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
      responses:
        '200':
          description: Usage for the level
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageEnvelope'
        '400':
          description: Malformed scope, group_by, range, window or cursor
        '404':
          description: Level not found or not visible (always coded)
components:
  schemas:
    UsageEnvelope:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/UsageResponse'
    UsageResponse:
      type: object
      required:
        - scope
        - window
        - totals
        - by_harness
        - rows
        - overlap_devs
        - series
        - has_more
      properties:
        by_harness:
          type: array
          items:
            $ref: '#/components/schemas/HarnessEntry'
        has_more:
          type: boolean
        next_cursor:
          type:
            - string
            - 'null'
        overlap_devs:
          type: integer
          format: int64
        prev_cursor:
          type:
            - string
            - 'null'
        recent_sessions:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/RecentSession'
        rows:
          type: array
          items:
            type: object
          description: The scope's children. Always empty at the Individual level.
        scope:
          $ref: '#/components/schemas/UsageScope'
        series:
          type: array
          items:
            $ref: '#/components/schemas/SeriesPoint'
        totals:
          $ref: '#/components/schemas/HarnessTotals'
        window:
          $ref: '#/components/schemas/UsageWindow'
    HarnessEntry:
      allOf:
        - $ref: '#/components/schemas/HarnessTotals'
        - type: object
          required:
            - harness
            - top_models
            - models
            - subagent_runs
            - tools
          properties:
            harness:
              type: string
            models:
              type: array
              items:
                $ref: '#/components/schemas/HarnessModel'
              description: >-
                Most turns first, ties by name. A mixed-model turn has no single
                model

                (`trace_usage.model` is NULL) and is left out, so these need not
                add up

                to the harness's own totals.
            subagent_runs:
              type: integer
              format: int64
              description: Subagent sessions whose first turn started in the window.
            tools:
              type: array
              items:
                $ref: '#/components/schemas/HarnessTool'
              description: Most calls first, ties by name.
            top_models:
              type: array
              items:
                type: string
              description: The first names in `models`.
    RecentSession:
      type: object
      required:
        - session_id
        - harness
        - started_at
        - turns
        - cost_usd
      properties:
        cost_usd:
          type: number
          format: double
        harness:
          type: string
        session_id:
          type: string
        started_at:
          type: string
        turns:
          type: integer
          format: int64
    UsageScope:
      type: object
      required:
        - kind
        - label
        - visibility
      properties:
        kind:
          type: string
        label:
          type: string
        user_id:
          type:
            - string
            - 'null'
        visibility:
          type: string
    SeriesPoint:
      type: object
      required:
        - date
        - harness
        - active_devs
        - cost_usd
        - tokens
      properties:
        active_devs:
          type: integer
          format: int64
        cost_usd:
          type: number
          format: double
        date:
          type: string
        harness:
          type: string
        tokens:
          type: integer
          format: int64
    HarnessTotals:
      type: object
      required:
        - scope_devs
        - active_devs
        - registered_devs
        - idle_seats
        - sessions
        - turns
        - tokens
        - cost_usd
        - unpriced_calls
      properties:
        active_devs:
          type: integer
          format: int64
        cost_usd:
          type: number
          format: double
        delta_pct:
          type:
            - number
            - 'null'
          format: double
          description: |-
            Change in **turns** against the previous window, one decimal. `null`
            without `compare`, and when the previous window had no turns — an
            undefined percentage, not a fabricated 0.
        idle_seats:
          type: integer
          format: int64
          description: Registered (developer, harness) pairs with no turn in the window.
        registered_devs:
          type: integer
          format: int64
          description: Users with at least one agent registered for this harness.
        scope_devs:
          type: integer
          format: int64
          description: >-
            Distinct active, non-deleted users in scope. Always 1 here: the
            caller.
        sessions:
          type: integer
          format: int64
        tokens:
          type: integer
          format: int64
        turns:
          type: integer
          format: int64
        unpriced_calls:
          type: integer
          format: int64
    UsageWindow:
      type: object
      required:
        - start_time
        - end_time
      properties:
        end_time:
          type: string
        range:
          type:
            - string
            - 'null'
        start_time:
          type: string
    HarnessModel:
      type: object
      description: One model's share of a harness's turns in the window.
      required:
        - model
        - turns
        - tokens
        - cost_usd
      properties:
        cost_usd:
          type: number
          format: double
        model:
          type: string
        tokens:
          type: integer
          format: int64
          description: Token counts for every token class.
        turns:
          type: integer
          format: int64
    HarnessTool:
      type: object
      description: One tool's calls through a harness in the window.
      required:
        - name
        - calls
        - failed
      properties:
        calls:
          type: integer
          format: int64
        failed:
          type: integer
          format: int64
          description: >-
            Calls that ended `failed` or `timed_out`: ingest's
            `turn_tool_errors`

            rule. A denied or cancelled call is the user's decision, not a
            failure.
        name:
          type: string
  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.