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

# Get a usage breakdown

> Owner or billing role. from and to are both required RFC 3339 timestamps, unlike GET .../usage's all-time default; from must precede to. Reports the two supported billable metrics with their share of priced usage and each one's heaviest consumer.



## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/organizations/{organization_id}/usage/breakdown
openapi: 3.1.0
info:
  title: Bonya Compute REST API
  version: 0.1.0
  description: >
    Public REST and WebSocket surface on TApi behind Caddy. Non-2xx responses
    are RFC 9457 application/problem+json with a stable machine-readable code.
    WebSocket endpoints are HTTP GET upgrades; their options travel in the START
    frame, never in query strings.
servers:
  - url: https://api.bonya.ai
    description: Production
security:
  - personalApiKey: []
  - supabaseJwt: []
tags:
  - name: Sandboxes
    description: Create, look up, list, pause, fork, snapshot, and delete sandboxes.
  - name: Snapshots
    description: Named point-in-time copies of a sandbox that new sandboxes can start from.
  - name: Templates
    description: Saved, versioned launch configurations for sandboxes.
  - name: Registry Connections
    description: Credentials for pulling private container images.
  - name: Secrets
    description: Write-only secrets and secret sets injected into sandboxes and jobs.
  - name: Previews
    description: Expose a sandbox port as an HTTPS URL.
  - name: Exec
    description: Run a command in a sandbox, buffered or over a TTY.
  - name: Sessions
    description: Named, persistent command sessions that outlive a connection.
  - name: Filesystem
    description: Read, write, and manage files inside a sandbox.
  - name: Jobs
    description: Managed, tracked runs of a command or script.
  - name: Job Schedules
    description: Cron, interval, or one-shot timing wrapped around a job.
  - name: Organizations
    description: Organization membership, administration and usage reporting.
  - name: Invitations
    description: Invite members to an organization and accept invitations.
  - name: API Keys
    description: Personal API key management.
  - name: Device Login
    description: Browser-based login for the CLI.
paths:
  /v1/organizations/{organization_id}/usage/breakdown:
    get:
      tags:
        - Organizations
      summary: Get a usage breakdown
      description: >-
        Owner or billing role. from and to are both required RFC 3339
        timestamps, unlike GET .../usage's all-time default; from must precede
        to. Reports the two supported billable metrics with their share of
        priced usage and each one's heaviest consumer.
      operationId: getOrganizationUsageBreakdown
      parameters:
        - $ref: '#/components/parameters/OrganizationID'
        - name: from
          in: query
          required: true
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          required: true
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Usage breakdown
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageBreakdown'
        default:
          $ref: '#/components/responses/Problem'
      security:
        - supabaseJwt: []
components:
  parameters:
    OrganizationID:
      name: organization_id
      in: path
      required: true
      schema:
        type: string
  schemas:
    UsageBreakdown:
      type: object
      required:
        - currency
        - period
        - services
        - members
        - degraded
      properties:
        currency:
          type: string
        period:
          $ref: '#/components/schemas/BillingPeriod'
        services:
          type: array
          items:
            $ref: '#/components/schemas/BillingServiceUsage'
        members:
          type: array
          items:
            $ref: '#/components/schemas/BillingMemberUsage'
        degraded:
          type: array
          items:
            $ref: '#/components/schemas/Degradation'
    BillingPeriod:
      type: object
      required:
        - from
        - to
      properties:
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
    BillingServiceUsage:
      type: object
      required:
        - metric_code
        - unit
        - units
      properties:
        metric_code:
          type: string
          enum:
            - nest_compute_seconds
            - nest_storage_hours
        unit:
          type: string
        units:
          type: number
        estimated_cents:
          type: integer
          format: int64
          description: >-
            Present only together with share, when prices were read
            successfully.
        share:
          type: number
          description: >-
            Has no meaning without a price: it compares metrics measured in
            different units, so money is the only common unit and there is no
            unpriced fallback.
        heaviest:
          type: object
          description: Absent when the metric has no recorded usage at all.
          required:
            - units
          properties:
            user_id:
              type: string
            unattributed:
              type: boolean
            units:
              type: number
    BillingMemberUsage:
      type: object
      description: >-
        One member's share of usage. An empty user id is the unattributed bucket
        -- usage whose opening actor record was lost -- reported as
        unattributed: true rather than an empty user_id, so a consumer cannot
        mistake it for a member whose id failed to render. Exactly one of
        user_id or unattributed is present.
      required:
        - compute_seconds
        - storage_hours
      properties:
        user_id:
          type: string
        unattributed:
          type: boolean
        compute_seconds:
          type: number
        storage_hours:
          type: number
    Degradation:
      type: string
      enum:
        - balance
        - prices
        - limits
        - offers
      description: >-
        One provider-dependent enrichment that was attempted and did not produce
        a usable value. Never emitted for a value that is legitimately absent.
    Problem:
      type: object
      required:
        - type
        - title
        - status
        - code
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
        code:
          type: string
        detail:
          type: string
  responses:
    Problem:
      description: RFC 9457 problem
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    personalApiKey:
      type: http
      scheme: bearer
      description: >-
        Personal byk_ API key; user-principal, resolved to a tenant by org
        context.
    supabaseJwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Supabase-issued session JWT; required for org, invite, and key
        management.

````

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