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

# Get usage

> **Token scope:** `account` · `org` · `project` — read-only tokens allowed.

Project usage across the 5 billing dimensions over a window (default current cycle)



## OpenAPI

````yaml /openapi/project.json get /projects/{projectId}/usage
openapi: 3.1.0
info:
  title: InstaCloud API — Project level
  version: 0.1.0
  description: >-
    Endpoints under `/projects/{projectId}`: branches, services, deploys,
    secrets, databases, storage, cron, observability, governance. Callable with
    any token whose binding covers the project.


    Generated from the platform's own OpenAPI document
    (https://api.instacloud.com/openapi.json); see the [API
    overview](/reference/api/overview) for authentication and token scopes.
servers:
  - url: https://api.instacloud.com
    description: InstaCloud
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: Projects inside an organization.
  - name: Branches
    description: >-
      Branch environments of a project: isolated database, storage and compute
      per branch.
  - name: Services
    description: 'Services on a branch: compute, postgres, storage and managed databases.'
  - name: Deploy
    description: Deploy an image or a source to a compute service.
  - name: Compute
    description: Build output of a compute service.
  - name: Secrets
    description: User secrets, service credentials and how they bind into compute env.
  - name: Database
    description: Postgres databases, extensions, credentials and ad-hoc SQL.
  - name: Storage
    description: Objects in a storage service.
  - name: Backups
    description: Database backups and restores.
  - name: Cron
    description: Scheduled HTTP calls against a service or an external URL.
  - name: Observability
    description: Logs, metrics, deploy events and database insight.
  - name: Governance
    description: Per-project agent policy and the approval queue.
  - name: Audit
    description: The project's event timeline, including agent-ingested events.
  - name: Domains
    description: >-
      Domains bought through InstaCloud, bring-your-own zones and their DNS
      records.
  - name: Billing
    description: Usage, cycles, invoices and credits.
  - name: Templates
    description: Deploy a template into a project.
paths:
  /projects/{projectId}/usage:
    get:
      tags:
        - Billing
      summary: Get usage
      description: >-
        **Token scope:** `account` · `org` · `project` — read-only tokens
        allowed.


        Project usage across the 5 billing dimensions over a window (default
        current cycle)
      operationId: getUsage
      parameters:
        - schema:
            type: integer
          in: query
          name: from
          required: false
          description: unix seconds (default current cycle start)
        - schema:
            type: integer
          in: query
          name: to
          required: false
          description: unix seconds (default current cycle end)
        - schema:
            format: uuid
            type: string
          in: path
          name: projectId
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectUsage'
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ProjectUsage:
      type: object
      properties:
        from:
          type: integer
        to:
          type: integer
        dimensions:
          type: array
          items:
            $ref: '#/components/schemas/DimensionUsage'
        totalCostUsd:
          type: number
        byService:
          description: >-
            the same window and the same money split by service — deleted
            services included, plus one unattributed bucket where the service is
            unrecoverable. Sums to totalCostUsd. A postgres lineage ROOT is
            attributed to its origin service, so a forked environment’s database
            cost lands on the service it was forked from.
          type: array
          items:
            $ref: '#/components/schemas/ServiceUsage'
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    DimensionUsage:
      type: object
      properties:
        dimension:
          type: string
          enum:
            - ram
            - cpu
            - volume
            - storage
            - egress
        quantity:
          type: number
        unit:
          example: GB·min
          type: string
        costUsd:
          description: quantity × unit price for this dimension in the window
          type: number
    ServiceUsage:
      type: object
      properties:
        serviceId:
          format: uuid
          description: >-
            null for the unattributed bucket: spend with no live service to name
            — its environment was deleted, or the resource predates service
            attribution (pre-0010, never backfilled). NOT spend of zero
          type:
            - string
            - 'null'
        name:
          type:
            - string
            - 'null'
        type:
          description: postgres | storage | compute | redis | mysql | mongodb
          type:
            - string
            - 'null'
        status:
          description: '''deleted'' for a service that is gone but still owns history'
          type:
            - string
            - 'null'
        branch:
          description: the environment it belonged to; null for the unattributed bucket
          type:
            - string
            - 'null'
        dimensions:
          type: array
          items:
            $ref: '#/components/schemas/DimensionUsage'
        totalCostUsd:
          type: number
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Session access JWT or an API token (`insta_<prefix>_<secret>`).

````