> ## 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 team billing usage

> Returns billing usage for the specified team and billing period.
Customer callers may only access their own team and must hold
`billing:read`.




## OpenAPI

````yaml https://raw.githubusercontent.com/superserve-ai/sandbox/refs/heads/main/api/openapi.yaml get /teams/{team_id}/billing/usage
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:
  /teams/{team_id}/billing/usage:
    parameters:
      - name: team_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Billing
      summary: Get team billing usage
      description: |
        Returns billing usage for the specified team and billing period.
        Customer callers may only access their own team and must hold
        `billing:read`.
      operationId: getTeamBillingUsage
      parameters:
        - name: period_start
          in: query
          required: false
          schema:
            type: string
            format: date-time
        - name: period_end
          in: query
          required: false
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Team billing usage for the requested period
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamBillingUsageResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - apiKey: []
components:
  schemas:
    TeamBillingUsageResponse:
      type: object
      required:
        - period_id
        - team_id
        - status
        - period_start
        - period_end
        - vcpu_seconds
        - memory_mib_seconds
        - storage_mib_seconds
        - cpu_vcpu_hours
        - memory_gib_hours
        - storage_gib_hours
        - resources
        - updated_at
      properties:
        period_id:
          type: string
        team_id:
          type: string
          format: uuid
        status:
          type: string
        period_start:
          type: string
          format: date-time
        period_end:
          type: string
          format: date-time
        vcpu_seconds:
          type: number
          format: double
        memory_mib_seconds:
          type: number
          format: double
        storage_mib_seconds:
          type: number
          format: double
        cpu_vcpu_hours:
          type: number
          format: double
        memory_gib_hours:
          type: number
          format: double
        storage_gib_hours:
          type: number
          format: double
        resources:
          type: array
          items:
            $ref: '#/components/schemas/BillingUsageResource'
        resources_by_key:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/BillingUsageResource'
        exported_at:
          type: string
          format: date-time
        finalized_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    BillingUsageResource:
      type: object
      required:
        - resource_key
        - resource
        - display_name
        - sort_order
        - unit
        - display_unit
        - usage
        - tracked
        - billable
      properties:
        resource_key:
          type: string
        resource:
          type: string
        display_name:
          type: string
        sort_order:
          type: integer
        unit:
          type: string
        display_unit:
          type: string
        usage:
          type: number
          format: double
        tracked:
          type: boolean
        billable:
          type: boolean
    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'
    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

````