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

# Get billing summary

> Returns team-level financial information for the authenticated team's
current billing period. All charge fields are monetary USD values, not
raw usage metrics. The team is derived from authentication; callers
cannot select a team by query parameter.

Access requires `billing:read` and the `tenant_usage_dashboard`
rollout gate to be enabled for the team.

Phase 1 assumes no pricing tier or rate changes within the current
billing period. The summary applies the team's currently active pricing
rates to all current-period usage.




## OpenAPI

````yaml https://raw.githubusercontent.com/superserve-ai/sandbox/refs/heads/main/api/openapi.yaml get /billing/summary
openapi: 3.1.0
info:
  title: Superserve API
  version: 0.1.0
  description: >
    Superserve provides sandbox infrastructure to run AI agents in the cloud.
    Powered by Firecracker MicroVMs.


    ## Sandbox lifecycle


    ```

    active <--> paused --> deleted

    ```


    A sandbox is `active` when running and `paused` after being paused. Resuming

    a paused sandbox returns it to `active`. Deleting releases all resources.


    | Endpoint | What it does |

    |----------|-------------|

    | `POST /sandboxes` | Create a new sandbox (optionally `from_template`) |

    | `PATCH /sandboxes/:id` | Partially update a running sandbox (e.g. network
    rules) |

    | `POST /sandboxes/:id/pause` | Snapshot full state, suspend the VM |

    | `POST /sandboxes/:id/resume` | Restore from snapshot, continue where it
    left off |

    | `DELETE /sandboxes/:id` | Delete sandbox and all resources |


    ## Sandbox environment


    By default sandboxes boot from the curated `superserve/base` template
    (Ubuntu 24.04,

    1 vCPU, 1 GB RAM, 4 GB disk, with Python 3.12, Node.js 22, npm, git, curl,

    and build-essential pre-installed). Callers can override with any template

    name (e.g. `superserve/python-3.11`, `superserve/node-22`) or a team-owned
    template UUID

    via the `from_template` field on `POST /sandboxes`.


    ## Files and commands


    `/files`, `/exec`, and `/exec/stream` run against a single sandbox and use

    its `X-Access-Token` (returned by create, resume, and activate), not the

    team API key. Two host forms reach them:


    - `https://sandbox.superserve.ai/...` with `X-Superserve-Sandbox-Id:
    <sandbox_id>`.

    - `https://boxd-{sandbox_id}.sandbox.superserve.ai/...` — no routing header
    needed.
  contact:
    name: Superserve Team
  license:
    name: Proprietary
servers:
  - url: https://api.superserve.ai
    description: Production
security: []
paths:
  /billing/summary:
    get:
      tags:
        - Billing
      summary: Get billing summary
      description: |
        Returns team-level financial information for the authenticated team's
        current billing period. All charge fields are monetary USD values, not
        raw usage metrics. The team is derived from authentication; callers
        cannot select a team by query parameter.

        Access requires `billing:read` and the `tenant_usage_dashboard`
        rollout gate to be enabled for the team.

        Phase 1 assumes no pricing tier or rate changes within the current
        billing period. The summary applies the team's currently active pricing
        rates to all current-period usage.
      operationId: getBillingSummary
      responses:
        '200':
          description: Current billing period financial summary
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingSummaryResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          description: Pricing is not available for the authenticated team's active plan
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    BillingSummaryResponse:
      type: object
      required:
        - current_charges_usd
        - credits_applied_usd
        - credits_remaining_usd
        - expected_invoice_amount_usd
        - cost_breakdown_usd
        - billing_period
        - pricing_tier
        - calculated_at
      properties:
        current_charges_usd:
          type: number
          format: double
          description: Current period charges before credits.
        credits_applied_usd:
          type: number
          format: double
          description: Credits applied against the current period charges.
        credits_remaining_usd:
          type: number
          format: double
          description: Credits still available after applying current period charges.
        expected_invoice_amount_usd:
          type: number
          format: double
          description: Expected invoice amount after credits.
        cost_breakdown_usd:
          type: object
          required:
            - compute
            - memory
            - storage
          properties:
            compute:
              type: number
              format: double
              description: vCPU charges for the current period.
            memory:
              type: number
              format: double
              description: memory charges for the current period.
            storage:
              type: number
              format: double
              description: storage charges for the current period.
        billing_period:
          type: object
          required:
            - start
            - end
          properties:
            start:
              type: string
              format: date-time
            end:
              type: string
              format: date-time
        pricing_tier:
          type: object
          required:
            - plan_key
            - plan_name
            - currency
          properties:
            plan_key:
              type: string
              example: payg
            plan_name:
              type: string
              example: Pay-as-you-go
            currency:
              type: string
              example: USD
        calculated_at:
          type: string
          format: date-time
          description: Timestamp when this live billing summary was calculated.
    Error:
      type: object
      description: |
        Error envelope. `error.code` is a stable, machine-readable identifier
        (e.g. `bad_request`, `not_found`, `conflict`, `rate_limited`,
        `too_many_builds`, `too_many_templates`, `too_many_sandboxes`,
        `image_pull_failed`, `step_failed`, `snapshot_failed`,
        `start_cmd_failed`, `ready_cmd_failed`, `build_failed`).
        `error.message` is human-readable and may change between releases;
        clients should branch on `code`, not `message`.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Caller is authenticated but not allowed to perform the action
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: >
        Rate limit hit — the caller's per-team request budget is temporarily
        exhausted. Response body uses error code `rate_limited`. Retry after a
        short backoff; the bucket refills continuously.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key

````