> ## 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 /latest.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).
            Defaults to a few days before `end_ts`. 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).
            Defaults to now. 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-02T00:00:00Z'
        - name: interval
          in: query
          description: >-
            Omit to receive a single bucket spanning from `start_ts` to
            `end_ts`.
          required: false
          schema:
            $ref: '#/components/schemas/UsageInterval'
            nullable: true
        - name: api_key_id
          in: query
          description: If provided, only returns usage attributable to the given API key.
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageCreditsResponse'
      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'
        enum:
          - '2026-03-01'
  schemas:
    UsageInterval:
      title: UsageInterval
      type: string
      description: Groups usage data into buckets according to time.
      enum:
        - day
        - week
        - month
    UsageCreditsResponse:
      title: UsageCreditsResponse
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/UsageCreditsBucket'
          description: >-
            Credit usage buckets in chronological order. Buckets with no
            recorded usage are returned with `credits: 0`.
      required:
        - data
    UsageCreditsBucket:
      title: UsageCreditsBucket
      type: object
      description: A single bucket of credit usage within a time window.
      properties:
        start_ts:
          type: string
          format: date-time
          description: An RFC 3339 formatted datetime string.
          example: '2026-01-01T00:00:00.000Z'
        end_ts:
          type: string
          format: date-time
          description: An RFC 3339 formatted datetime string.
          example: '2026-01-02T00:00:00.000Z'
        credits:
          type: integer
          description: Total credits consumed within the bucket.
      required:
        - start_ts
        - end_ts
        - credits
  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).

````