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

# Get Credit Usage

> Returns your credit usage over time, bucketed by the requested interval.



## OpenAPI

````yaml 2026-03-01/api.yml GET /usage/credits
openapi: 3.0.1
info:
  title: Cartesia API
  version: 0.0.1
servers:
  - url: https://api.cartesia.ai
    description: Production
security: []
paths:
  /usage/credits:
    get:
      tags:
        - Usage
      summary: Get Credit Usage
      description: Returns your credit usage over time, bucketed by the requested interval.
      operationId: usage_credits
      parameters:
        - $ref: '#/components/parameters/CartesiaVersionHeader'
        - name: start_ts
          in: query
          description: >-
            Start of the time window, as an RFC 3339 datetime (with timezone).
            Rounded down to the start of the UTC day. `start_ts` to `end_ts`
            cannot span more than a year.
          required: false
          schema:
            type: string
            format: date-time
            nullable: true
            example: '2026-01-01T00:00:00Z'
        - name: end_ts
          in: query
          description: >-
            End of the time window, as an RFC 3339 datetime (with timezone).
            Rounded up to the start of the next UTC day, unless already at
            midnight. `start_ts` to `end_ts` cannot span more than a year.
          required: false
          schema:
            type: string
            format: date-time
            nullable: true
            example: '2026-01-03T00:00:00Z'
        - name: interval
          in: query
          description: >-
            Omit to receive a single bucket spanning from `start_ts` to
            `end_ts`. When `group_by` is set, must be `day` if provided.
          required: false
          schema:
            $ref: '#/components/schemas/UsageInterval'
            nullable: true
          example: day
        - name: api_key_id
          in: query
          description: >-
            Filter usage to a single API key. When set, only credits
            attributable to that key are returned. Can be combined with
            `group_by` for other dimensions (`capability`, `model`, `voice`),
            but not with `group_by=api_key`.
          required: false
          schema:
            type: string
            format: uuid
            nullable: true
        - name: group_by
          in: query
          description: >-
            Break down credit usage by capability, model, voice, or API key.
            When `interval` is set it must be `day`. Cannot be combined with
            `api_key_id` when `group_by=api_key`.
          required: false
          schema:
            $ref: '#/components/schemas/UsageCreditsGroupBy'
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageCreditsResponse'
              example:
                data:
                  - start_ts: '2026-01-01T00:00:00.000Z'
                    end_ts: '2026-01-02T00:00:00.000Z'
                    credits: 1200
                  - start_ts: '2026-01-02T00:00:00.000Z'
                    end_ts: '2026-01-03T00:00:00.000Z'
                    credits: 980
      security:
        - AdminAPIKeyAuth: []
components:
  parameters:
    CartesiaVersionHeader:
      name: Cartesia-Version
      in: header
      description: API version header.
      required: true
      schema:
        type: string
        format: date
        example: '2026-03-01'
        default: '2026-03-01'
        enum:
          - '2026-03-01'
  schemas:
    UsageInterval:
      title: UsageInterval
      type: string
      description: Groups usage data into buckets according to time.
      enum:
        - day
        - week
        - month
    UsageCreditsGroupBy:
      title: UsageCreditsGroupBy
      type: string
      description: Dimension to break credit usage down by.
      enum:
        - capability
        - model
        - voice
        - api_key
    UsageCreditsResponse:
      title: UsageCreditsResponse
      type: object
      properties:
        group_by:
          $ref: '#/components/schemas/UsageCreditsGroupBy'
          description: Present when the request included `group_by`.
        data:
          type: array
          description: >-
            Without `group_by`, flat credit usage buckets in chronological
            order. With `group_by`, one entry per dimension value; each item
            includes `id`, optional `label`, and nested daily `buckets`. Empty
            usage periods are returned with `credits: 0`.
          items:
            oneOf:
              - $ref: '#/components/schemas/UsageCreditsBucket'
              - $ref: '#/components/schemas/UsageCreditsBreakdownSeries'
      required:
        - data
    UsageCreditsBucket:
      title: UsageCreditsBucket
      type: object
      description: A single bucket of credit usage within a time window.
      properties:
        start_ts:
          $ref: '#/components/schemas/UsageBucketStartTimestamp'
        end_ts:
          $ref: '#/components/schemas/UsageBucketEndTimestamp'
        credits:
          type: integer
          description: Total credits consumed within the bucket.
      required:
        - start_ts
        - end_ts
        - credits
    UsageCreditsBreakdownSeries:
      title: UsageCreditsBreakdownSeries
      type: object
      description: Credit usage for one value of the requested group-by dimension.
      properties:
        id:
          type: string
          description: >-
            Identifier for the dimension value (capability id, model id, voice
            id, or API key id / sentinel such as `playground` or `unnamed_key`).
        label:
          type: string
          nullable: true
          description: >-
            Human-readable label when available (voice name, API key
            description, etc.).
        buckets:
          type: array
          items:
            $ref: '#/components/schemas/UsageCreditsBucket'
          description: Daily credit buckets for this dimension value.
      required:
        - id
        - buckets
    UsageBucketStartTimestamp:
      type: string
      format: date-time
      description: RFC 3339 timestamp for the start of the usage bucket.
      example: '2026-01-01T00:00:00.000Z'
    UsageBucketEndTimestamp:
      type: string
      format: date-time
      description: RFC 3339 timestamp for the end of the usage bucket.
      example: '2026-01-02T00:00:00.000Z'
  securitySchemes:
    AdminAPIKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: Admin API Key
      description: >-
        Cartesia admin API key (`sk_car_admin_...`). Get one at
        [play.cartesia.ai/keys/admin](https://play.cartesia.ai/keys/admin).
      x-default: $CARTESIA_ADMIN_API_KEY

````