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

> ## Agent Instructions
> Cerebrium's documentation MCP server is available at https://cerebrium.ai/docs/mcp for searching and querying these docs directly. Install the Cerebrium agent skill with `npx skills add https://cerebrium.ai/docs`. Append .md to any docs page URL to fetch that page as plain Markdown. API keys and authentication tokens are created in the Cerebrium dashboard at https://dashboard.cerebrium.ai.

# Get an app's request and cost breakdown over time

> How much traffic an app served and what it cost to run, over a chosen period. Requests are counted per time bucket and split by response status (2xx/4xx/5xx, normal and error WebSocket closes, and anything else); cost is split across GPU, CPU and memory. Every bucket in the period is returned, zero-filled where there was no activity, so the series can be charted without gap handling.



## OpenAPI

````yaml https://s3.eu-west-1.amazonaws.com/www.cerebrium.ai/openapi_spec.json get /v2/projects/{project_id}/apps/{app_id}/dashboard-metrics
openapi: 3.0.0
info:
  title: Cerebrium REST API
  description: >-
    REST API for interacting with Cerebrium. This API is mainly used by the
    Cerebrium CLI client, please run `pip install cerebrium` to install it.
  version: 1.0.0
  license:
    name: Proprietary
    url: https://www.cerebrium.ai/terms-of-service
servers:
  - url: https://rest.cerebrium.ai
security: []
paths:
  /v2/projects/{project_id}/apps/{app_id}/dashboard-metrics:
    get:
      tags:
        - Apps
      summary: Get an app's request and cost breakdown over time
      description: >-
        How much traffic an app served and what it cost to run, over a chosen
        period. Requests are counted per time bucket and split by response
        status (2xx/4xx/5xx, normal and error WebSocket closes, and anything
        else); cost is split across GPU, CPU and memory. Every bucket in the
        period is returned, zero-filled where there was no activity, so the
        series can be charted without gap handling.
      operationId: getAppDashboardMetrics
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
        - name: app_id
          in: path
          required: true
          schema:
            type: string
        - name: month
          in: query
          required: false
          description: >-
            Report on a whole billing month, in UTC. One of current or previous;
            defaults to current. Ignored when start and end are supplied. A
            billing month is longer than the minute and hour intervals allow, so
            those require start and end.
          schema:
            type: string
        - name: start
          in: query
          required: false
          description: >-
            Start of an arbitrary period, RFC3339. Takes precedence over month,
            and must be sent with end. Cannot be more than 180 days ago.
          schema:
            type: string
        - name: end
          in: query
          required: false
          description: >-
            End of an arbitrary period, RFC3339. Takes precedence over month,
            and must be sent with start.
          schema:
            type: string
        - name: interval
          in: query
          required: false
          description: >-
            Bucket size to group the series by: minute, hour, day (default) or
            month. Each caps how long a period you can ask for — 6 hours for
            minute, 7 days for hour, 180 days for day and month — and a longer
            one is rejected with a 400. Because a billing month is longer than
            the minute and hour caps, those intervals must be paired with start
            and end rather than month.
          schema:
            type: string
        - name: tz
          in: query
          required: false
          description: >-
            IANA timezone the buckets fall in, e.g. America/New_York. Defaults
            to UTC. Month and day buckets start at midnight in this zone, and
            minute and hour buckets on its minute or hour — which is not the UTC
            hour in zones offset by 30 or 45 minutes, such as Asia/Kolkata.
          schema:
            type: string
      responses:
        '200':
          description: >-
            Two zero-filled time series covering the whole period — requests by
            response status and cost by resource — plus a total for each. Both
            series are objects keyed by bucket start, in ascending key order.
          content:
            application/json:
              schema:
                properties:
                  cost_totals:
                    description: >-
                      Spend for the whole period, same fields as a costs entry.
                      Equal to the sum of the buckets.
                    type: object
                  costs:
                    description: >-
                      Spend per bucket in fractional cents, split into
                      gpu_cost_cents, cpu_cost_cents and memory_cost_cents
                      alongside total_cost_cents, with total_running_time_ms for
                      the container time that spend covers. Note the key format
                      differs from requests: month and day buckets are keyed
                      YYYY-MM-DD (a month by its first day), minute and hour
                      buckets RFC3339. unique_container_count is not populated.
                    type: object
                  end_date:
                    description: >-
                      End of the period actually reported on, RFC3339. Echoes
                      end, or the last moment of the billing month when month
                      was used.
                    type: string
                  interval:
                    description: >-
                      Bucket size the series were grouped by, echoing the
                      interval requested: minute, hour, day or month.
                    type: string
                  request_totals:
                    description: >-
                      Request counts for the whole period, same fields as a
                      requests entry. Equal to the sum of the buckets.
                    type: object
                  requests:
                    description: >-
                      Request counts per bucket, keyed by bucket start in
                      RFC3339. Month and day buckets fall at midnight in tz;
                      minute and hour buckets are instants expressed in UTC.
                      Each value splits total into 2xx, 4xx, 5xx,
                      websocket_success (close codes 1000-1001), websocket_error
                      (1002-1999), and other (anything outside those ranges,
                      including no status).
                    type: object
                  start_date:
                    description: >-
                      Start of the period actually reported on, RFC3339. Echoes
                      start, or the first moment of the billing month when month
                      was used.
                    type: string
                type: object
        '400':
          description: >-
            Bad request. The request was malformed or contained invalid
            parameters.
          content:
            application/json:
              schema:
                properties:
                  message:
                    description: Human-readable description of the error.
                    type: string
                type: object
        '401':
          description: >-
            Unauthorized. The Authorization header is missing or the token is
            invalid.
          content:
            application/json:
              schema:
                properties:
                  message:
                    description: Human-readable description of the error.
                    type: string
                type: object
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Service Account Token authentication. To authenticate API requests:


        1. **Create a Service Account Token:**
           - Go to the [Cerebrium Dashboard](https://dashboard.cerebrium.ai/) and open the **API Keys** page
           - Click **Create Service Account**, name it (e.g., "GitHub Actions CI/CD"), choose an expiry date, and click **Create**
           - **Copy the token** generated for the desired service account

        2. **Use the Token:**
           Include the service account token in the Authorization header of API requests:
           `Authorization: Bearer <your-service-account-token>`

        3. **Best Practices:**
           - Create separate service accounts for different environments (dev, staging, prod)
           - Store tokens securely as secrets in consuming applications or workflows
           - Set appropriate expiry dates and rotate tokens regularly
           - Never commit tokens to source control

        For CI/CD integration examples, see the [CI/CD
        documentation](https://docs.cerebrium.ai/cerebrium/deployments/ci-cd).

````