> ## 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 a session

> Traces, token usage and a cost summary for one session.



## OpenAPI

````yaml /api-reference/openapi.json get /api/observability/session/{session_id}
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/session/{session_id}:
    get:
      tags:
        - observability
      summary: Get a session
      description: Traces, token usage and a cost summary for one session.
      operationId: get_session_details
      parameters:
        - name: session_id
          in: path
          description: A2A context/session ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Session detail
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionDetailResponse'
        '404':
          description: Session not found in the observability backend
components:
  schemas:
    SessionDetailResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/SessionDetailData'
    SessionDetailData:
      type: object
      required:
        - session
      properties:
        session:
          $ref: '#/components/schemas/SessionDetail'
    SessionDetail:
      type: object
      required:
        - id
        - session_id
        - num_traces
        - token_usage
        - cost_summary
        - cache_read_tokens
        - cache_creation_tokens
        - metrics_complete
        - subagents
        - traces
        - pagination
      properties:
        agent_name:
          type:
            - string
            - 'null'
        cache_creation_tokens:
          type: integer
          format: int64
          minimum: 0
        cache_read_tokens:
          type: integer
          format: int64
          description: >-
            Prompt tokens served from / written to provider cache, over the
            session.
          minimum: 0
        cost_summary:
          $ref: '#/components/schemas/FullCostSummary'
        id:
          type: string
        latency_avg:
          type:
            - number
            - 'null'
          format: double
          description: >-
            Mean trace duration, which is what the KPI strip labels "Avg
            latency".
        latency_p50:
          type:
            - number
            - 'null'
          format: double
        latency_p99:
          type:
            - number
            - 'null'
          format: double
          description: >-
            The session page renders this KPI (`s.latency_p99`); it was silently

            `0.0 s` for every session while the field didn't exist in the
            response.
        metrics_complete:
          type: boolean
        num_traces:
          type: integer
          minimum: 0
        pagination:
          $ref: '#/components/schemas/Pagination'
        parent_session_id:
          type:
            - string
            - 'null'
          description: The session that spawned this one, when it is a subagent.
        session_id:
          type: string
        spawn_tool_call_id:
          type:
            - string
            - 'null'
          description: The parent's tool call that spawned this session.
        subagent_type:
          type:
            - string
            - 'null'
          description: The subagent's kind as the coding agent names it (e.g. "Explore").
        subagents:
          type: array
          items:
            $ref: '#/components/schemas/SubagentRun'
          description: |-
            Sessions this one spawned, oldest first, each with its own totals —
            never included in this session's own figures.
        title:
          type:
            - string
            - 'null'
          description: >-
            LLM-derived session name from `chat_sessions`. `None` for sessions
            that

            never went through chat (CLI / direct A2A), where the id is the
            heading.
        token_usage:
          $ref: '#/components/schemas/TokenUsageSummary'
        traces:
          type: array
          items:
            $ref: '#/components/schemas/TraceEntry'
    FullCostSummary:
      type: object
      required:
        - total
        - prompt
        - completion
        - cache_read
        - cache_creation
      properties:
        cache_creation:
          $ref: '#/components/schemas/CostWithTokens'
        cache_read:
          $ref: '#/components/schemas/CostWithTokens'
        completion:
          $ref: '#/components/schemas/CostWithTokens'
        prompt:
          $ref: '#/components/schemas/CostWithTokens'
        total:
          $ref: '#/components/schemas/CostWithTokens'
    Pagination:
      type: object
      required:
        - has_next_page
      properties:
        end_cursor:
          type:
            - string
            - 'null'
        has_next_page:
          type: boolean
    SubagentRun:
      type: object
      description: One child of a session, as its detail lists it.
      required:
        - session_id
        - turns
      properties:
        cost:
          type:
            - number
            - 'null'
          format: double
        end_time:
          type:
            - string
            - 'null'
        session_id:
          type: string
        spawn_tool_call_id:
          type:
            - string
            - 'null'
          description: The parent's tool call that spawned it.
        start_time:
          type:
            - string
            - 'null'
        subagent_type:
          type:
            - string
            - 'null'
          description: The subagent's kind as the coding agent names it (e.g. "Explore").
        title:
          type:
            - string
            - 'null'
          description: >-
            What the harness called the run, from its `agent-<id>.meta.json`
            description.
        tokens:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        turns:
          type: integer
          format: int32
          minimum: 0
    TokenUsageSummary:
      type: object
      properties:
        total:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
    TraceEntry:
      type: object
      required:
        - id
        - trace_id
        - root_span
        - cursor
      properties:
        cursor:
          type: string
        id:
          type: string
        root_span:
          $ref: '#/components/schemas/RootSpanEntry'
        trace_id:
          type: string
    CostWithTokens:
      type: object
      required:
        - cost
        - tokens
      properties:
        cost:
          type: number
          format: double
        tokens:
          type: integer
          format: int64
          minimum: 0
    RootSpanEntry:
      type: object
      required:
        - id
        - span_id
        - attributes
        - cumulative_token_count_total
        - input_tokens
        - output_tokens
        - cache_read_tokens
        - cache_creation_tokens
        - latency_ms
        - span_annotations
        - span_annotation_summaries
        - project
        - input
        - output
        - trace
      properties:
        attributes:
          type: string
        cache_creation_tokens:
          type: integer
          format: int64
          minimum: 0
        cache_read_tokens:
          type: integer
          format: int64
          minimum: 0
        cumulative_token_count_total:
          type: integer
          format: int64
          minimum: 0
        id:
          type: string
        input:
          $ref: '#/components/schemas/ContentField'
        input_tokens:
          type: integer
          format: int64
          description: >-
            Per-turn token split. `cumulative_token_count_total` is
            `input+output`;

            the cache counts are tracked separately and are not folded into it.
          minimum: 0
        latency_ms:
          type: number
          format: double
        output:
          $ref: '#/components/schemas/ContentField'
        output_tokens:
          type: integer
          format: int64
          minimum: 0
        project:
          $ref: '#/components/schemas/ProjectRef'
        span_annotation_summaries:
          type: array
          items:
            type: object
        span_annotations:
          type: array
          items:
            type: object
        span_id:
          type: string
        start_time:
          type:
            - string
            - 'null'
        trace:
          $ref: '#/components/schemas/TraceRef'
    ContentField:
      type: object
      required:
        - value
        - mime_type
      properties:
        mime_type:
          type: string
        parsed_value:
          type:
            - object
            - 'null'
        value:
          type: string
    ProjectRef:
      type: object
      required:
        - id
      properties:
        id:
          type: string
    TraceRef:
      type: object
      required:
        - id
        - cost_summary
      properties:
        cost_summary:
          type: object
        id:
          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.