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

# Get rated usage

> Estimate gross USD consumption value and net usage cost for eight non-AI products from corrected observed ledger quantities. Every period uses the current effective commercial plan prices and recurring allowances on the current billing schedule. Omit dates for its current cycle; without a current plan the UTC month is native-only. This read-only simulation excludes promotional first-cycle bonuses, subscription fees, taxes, AI tokens, and operational activity; it never recalculates or represents historical invoices and never converts credit prices to USD.



## OpenAPI

````yaml /openapi.json get /billing/usage/rated
openapi: 3.2.0
info:
  title: Sazabi Public API
  version: 1.0.0
  description: >
    Public REST API for Sazabi. Authenticate using a secret API key in the
    Authorization header.


    ## Pagination


    This API uses two pagination strategies depending on the endpoint type:


    ### Cursor-Based Pagination (List Endpoints)


    List endpoints (threads, messages, keys) use cursor-based pagination for
    efficient, consistent results:


    - **Parameters**: `limit` (items per page, default 50, max 100), `cursor`
    (opaque pagination token)

    - **Response**: Includes `nextCursor` field - pass this as `cursor` in the
    next request

    - **End of results**: When `nextCursor` is `null`, there are no more results

    - **Example**: `GET
    /v1/threads?limit=20&cursor=01234567-89ab-cdef-0123-456789abcdef`


    ### Page-Based Pagination (Search Endpoints)


    Search endpoints use page-based pagination due to the underlying search
    engine:


    - **Parameters**: `limit` (items per page, default 20, max 100), `page`
    (1-indexed page number)

    - **Response**: Includes `pagination` object with `page`, `limit`,
    `totalResults`, `totalPages`

    - **Example**: `GET /v1/search/threads?q=error&limit=10&page=2`
servers:
  - url: https://api.sazabi.com/v1
    description: Production
security: []
tags:
  - name: 'section: Send data'
    summary: Send data
    kind: nav
  - name: 'section: Detect issues'
    summary: Detect issues
    kind: nav
  - name: 'section: Triage issues'
    summary: Triage issues
    kind: nav
  - name: 'section: Ask Sazabi'
    summary: Ask Sazabi
    kind: nav
  - name: 'section: Explore logs'
    summary: Explore logs
    kind: nav
  - name: 'section: Ship fixes'
    summary: Ship fixes
    kind: nav
  - name: 'section: Integrations'
    summary: Integrations
    kind: nav
  - name: 'section: Organization and access'
    summary: Organization and access
    kind: nav
  - name: 'section: Billing'
    summary: Billing
    kind: nav
  - name: 'section: Webhooks and events'
    summary: Webhooks and events
    kind: nav
  - name: 'section: CLI onboarding support'
    summary: CLI onboarding support
    kind: nav
  - name: Log Sources
    summary: Log Sources
    kind: nav
    parent: 'section: Send data'
  - name: Log Streams
    summary: Log Streams
    kind: nav
    parent: 'section: Send data'
  - name: Public Keys
    summary: Public Keys
    kind: nav
    parent: 'section: Send data'
  - name: Signals
    summary: Signals
    kind: nav
    parent: 'section: Detect issues'
  - name: Issues
    summary: Issues
    kind: nav
    parent: 'section: Triage issues'
  - name: Components
    summary: Components
    kind: nav
    parent: 'section: Triage issues'
  - name: Notification delivery rules
    summary: Notification delivery rules
    kind: nav
    parent: 'section: Triage issues'
  - name: Notification channels
    summary: Notification channels
    kind: nav
    parent: 'section: Triage issues'
  - name: Tasks
    summary: Tasks
    kind: nav
    parent: 'section: Triage issues'
  - name: Task creation rules
    summary: Task creation rules
    kind: nav
    parent: 'section: Triage issues'
  - name: Task status mapping
    summary: Task status mapping
    kind: nav
    parent: 'section: Triage issues'
  - name: Work Items
    summary: Work Items
    kind: nav
    parent: 'section: Triage issues'
  - name: Threads
    summary: Threads
    kind: nav
    parent: 'section: Ask Sazabi'
  - name: Messages
    summary: Messages
    kind: nav
    parent: 'section: Ask Sazabi'
  - name: Runs
    summary: Runs
    kind: nav
    parent: 'section: Ask Sazabi'
  - name: Search
    summary: Search
    kind: nav
    parent: 'section: Ask Sazabi'
  - name: Memory
    summary: Memory
    kind: nav
    parent: 'section: Ask Sazabi'
  - name: Artifacts
    summary: Artifacts
    kind: nav
    parent: 'section: Ask Sazabi'
  - name: Tool permissions
    summary: Tool permissions
    kind: nav
    parent: 'section: Ask Sazabi'
  - name: Sandbox Environment Variables
    summary: Sandbox Environment Variables
    kind: nav
    parent: 'section: Ask Sazabi'
  - name: Sandbox Init Script
    summary: Sandbox Init Script
    kind: nav
    parent: 'section: Ask Sazabi'
  - name: Logs
    summary: Logs
    kind: nav
    parent: 'section: Explore logs'
  - name: Dashboards
    summary: Dashboards
    kind: nav
    parent: 'section: Explore logs'
  - name: AgentDispatches
    summary: AgentDispatches
    kind: nav
    parent: 'section: Ship fixes'
  - name: Pull Requests
    summary: Pull Requests
    kind: nav
    parent: 'section: Ship fixes'
  - name: Repos
    summary: Repos
    kind: nav
    parent: 'section: Ship fixes'
  - name: Integrations
    summary: Integrations
    kind: nav
    parent: 'section: Integrations'
  - name: MCP Connectors
    summary: MCP Connectors
    kind: nav
    parent: 'section: Integrations'
  - name: Connected Accounts
    summary: Connected Accounts
    kind: nav
    parent: 'section: Integrations'
  - name: Sandbox CLIs
    summary: Sandbox CLIs
    kind: nav
    parent: 'section: Integrations'
  - name: Auth
    summary: Auth
    kind: nav
    parent: 'section: Organization and access'
  - name: Organizations
    summary: Organizations
    kind: nav
    parent: 'section: Organization and access'
  - name: Projects
    summary: Projects
    kind: nav
    parent: 'section: Organization and access'
  - name: Members
    summary: Members
    kind: nav
    parent: 'section: Organization and access'
  - name: Teams
    summary: Teams
    kind: nav
    parent: 'section: Organization and access'
  - name: SSO
    summary: SSO
    kind: nav
    parent: 'section: Organization and access'
  - name: Secret Keys
    summary: Secret Keys
    kind: nav
    parent: 'section: Organization and access'
  - name: Support Tickets
    summary: Support Tickets
    kind: nav
    parent: 'section: Organization and access'
  - name: Billing
    summary: Billing
    kind: nav
    parent: 'section: Billing'
  - name: Webhooks
    summary: Webhooks
    kind: nav
    parent: 'section: Webhooks and events'
  - name: Webhook events
    summary: Webhook events
    kind: nav
    parent: 'section: Webhooks and events'
  - name: Onboarding
    summary: Onboarding
    kind: nav
    parent: 'section: CLI onboarding support'
  - name: Onboarding Tasks
    summary: Onboarding Tasks
    kind: nav
    parent: 'section: CLI onboarding support'
  - name: Recommendations
    summary: Recommendations
    kind: nav
    parent: 'section: CLI onboarding support'
paths:
  /billing/usage/rated:
    get:
      tags:
        - Billing
      summary: Get rated usage
      description: >-
        Estimate gross USD consumption value and net usage cost for eight non-AI
        products from corrected observed ledger quantities. Every period uses
        the current effective commercial plan prices and recurring allowances on
        the current billing schedule. Omit dates for its current cycle; without
        a current plan the UTC month is native-only. This read-only simulation
        excludes promotional first-cycle bonuses, subscription fees, taxes, AI
        tokens, and operational activity; it never recalculates or represents
        historical invoices and never converts credit prices to USD.
      operationId: billing.ratedUsage.get
      parameters:
        - name: cycleStartsAt
          in: query
          required: false
          schema:
            type: string
            format: date-time
          allowEmptyValue: true
          allowReserved: true
        - name: occurredAtFrom
          in: query
          required: false
          schema:
            type: string
            format: date-time
          allowEmptyValue: true
          allowReserved: true
        - name: occurredAtBefore
          in: query
          required: false
          schema:
            type: string
            format: date-time
          allowEmptyValue: true
          allowReserved: true
        - name: bucketMinutes
          in: query
          required: true
          schema:
            type: number
          allowEmptyValue: true
          allowReserved: true
        - name: bucketOriginStartsAt
          in: query
          required: false
          schema:
            type: string
            format: date-time
          allowEmptyValue: true
          allowReserved: true
        - name: organizationId
          in: query
          required: false
          schema:
            type: string
          allowEmptyValue: true
          allowReserved: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  calculationBasis:
                    const: current_plan
                    description: >-
                      Read-only estimate using current effective commercial
                      prices and recurring allowances for every period; never
                      actual historical billed amounts.
                  range:
                    type: object
                    properties:
                      startsAt:
                        type: string
                        format: date-time
                      endsAt:
                        type: string
                        format: date-time
                      isCurrentCycle:
                        type: boolean
                    required:
                      - startsAt
                      - endsAt
                      - isCurrentCycle
                  cycle:
                    anyOf:
                      - type: object
                        properties:
                          startsAt:
                            type: string
                            format: date-time
                          endsAt:
                            type: string
                            format: date-time
                        required:
                          - startsAt
                          - endsAt
                      - type: 'null'
                  currency:
                    const: USD
                  products:
                    type: array
                    items:
                      type: object
                      properties:
                        productKey:
                          enum:
                            - issues_created
                            - logs_accepted_bytes
                            - logs_query_bytes_scanned
                            - automation_runs_completed
                            - pull_requests_created
                            - pull_request_reviews_completed
                            - log_questions_answered
                            - log_queries_executed
                          type: string
                        quantity:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: >-
                            Native metered units (bytes or count), including
                            applied corrections. Null when measurement is
                            unavailable for this organization.
                        includedQuantity:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: >-
                            Current effective recurring plan allowance,
                            excluding promotional first-cycle bonuses; null
                            outside the exact current-cycle range, without
                            currency-priced terms, or when the allowance is
                            unlimited.
                        includedUnlimited:
                          type: boolean
                          description: >-
                            The current cycle's allowance is unlimited, so all
                            usage is included and `includedQuantity` is null.
                            Absent from older servers.
                        grantedQuantity:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: >-
                            Native units a usage grant covers in the range,
                            before the included allowance applies. Null when
                            measurement is unavailable.
                        valueCents:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: >-
                            Estimated decimal USD cents under the current
                            effective plan; null without supported current USD
                            terms. Credits are never converted to dollars.
                        chargeCents:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: >-
                            Estimated decimal USD cents under the current
                            effective plan; null without supported current USD
                            terms. Credits are never converted to dollars.
                        pricingStatus:
                          enum:
                            - complete
                            - unavailable
                          type: string
                        chargeStatus:
                          enum:
                            - estimated
                            - unavailable
                          type: string
                          description: >-
                            Estimated applies current recurring allowance
                            separately to each simulated billing cycle and
                            carries prior consumption into a partial selection.
                            Never represents an invoice or actual historical
                            charge.
                      required:
                        - productKey
                        - quantity
                        - includedQuantity
                        - valueCents
                        - chargeCents
                        - pricingStatus
                        - chargeStatus
                  buckets:
                    type: array
                    items:
                      type: object
                      properties:
                        bucketStartsAt:
                          type: string
                          format: date-time
                        productKey:
                          enum:
                            - issues_created
                            - logs_accepted_bytes
                            - logs_query_bytes_scanned
                            - automation_runs_completed
                            - pull_requests_created
                            - pull_request_reviews_completed
                            - log_questions_answered
                            - log_queries_executed
                          type: string
                        quantity:
                          anyOf:
                            - type: string
                            - type: 'null'
                        valueCents:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: >-
                            Estimated decimal USD cents under the current
                            effective plan; null without supported current USD
                            terms. Credits are never converted to dollars.
                      required:
                        - bucketStartsAt
                        - productKey
                        - quantity
                        - valueCents
                    description: >-
                      Fixed-duration buckets anchored to bucketOriginStartsAt
                      (default: range start), from the range start up to the
                      earlier of range.endsAt and now. Buckets are zero-filled
                      where nothing was measured, but none start after now, so a
                      range that ends in the future (such as the current cycle)
                      has no future buckets; range.endsAt still reports the full
                      requested end. Aggregate hourly buckets into local
                      calendar days on the client for DST.
                  totalValueCents:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      Estimated decimal USD cents under the current effective
                      plan; null without supported current USD terms. Credits
                      are never converted to dollars.
                  totalChargeCents:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      Estimated decimal USD cents under the current effective
                      plan; null without supported current USD terms. Credits
                      are never converted to dollars.
                required:
                  - calculationBasis
                  - range
                  - cycle
                  - currency
                  - products
                  - buckets
                  - totalValueCents
                  - totalChargeCents

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.