Skip to content
Sign in Create account

Billing Markup Breakdown

GET /api/v1/billing/markup-breakdown

Performs the account operation at /api/v1/billing/markup-breakdown.

Authenticate with a portal session token.

Responses

200 Usage-record billing breakdown for the current calendar month; receipts provide mode attributes only.

application/json object

  • currency string required

    Currency of raw usage_records and receipt provider micros.

    Value: "USD"
  • month string required
  • month_label string required
  • covers_legacy_usage boolean required

    True when monthly totals include all usage_records, including rows without receipts.

  • modes array of object required

    Each item:

    • has_receipt boolean required

      Whether the usage rows in this breakdown line have linked signed receipts.

    • unitemised boolean required

      True when a usage row cannot be assigned to a billing mode.

    • total_cost_micros integer required

      Exact billed amount in USD micros from usage_records; receipt amounts do not replace it.

  • total_calls integer required
  • total_fee_micros integer required

    Exact fee total in USD micros from usage_records.

  • total_fee_cents integer required
  • total_fee string required
  • total_billed_micros integer required

    Exact total in USD micros from usage_records.

  • total_billed_cents integer required
  • total_billed string required
  • no_receipt_calls integer required
  • has_traffic boolean required
  • cache_usage CacheUsageBreakdown required

Generated sample

{
  "currency": "USD",
  "month": "string",
  "month_label": "string",
  "covers_legacy_usage": true,
  "modes": [
    {
      "has_receipt": true,
      "unitemised": true,
      "total_cost_micros": 0
    }
  ],
  "total_calls": 0,
  "total_fee_micros": 0,
  "total_fee_cents": 0,
  "total_fee": "string",
  "total_billed_micros": 0,
  "total_billed_cents": 0,
  "total_billed": "string",
  "no_receipt_calls": 0,
  "has_traffic": true,
  "cache_usage": {
    "read": {
      "tokens": 0,
      "rate_cents_per_million": 0,
      "provider_cost_micros": 0,
      "unpriced_tokens": 0
    },
    "write_5m": {
      "tokens": 0,
      "rate_cents_per_million": 0,
      "provider_cost_micros": 0,
      "unpriced_tokens": 0
    },
    "write_1h": {
      "tokens": 0,
      "rate_cents_per_million": 0,
      "provider_cost_micros": 0,
      "unpriced_tokens": 0
    },
    "write_30m": {
      "tokens": 0,
      "rate_cents_per_million": 0,
      "provider_cost_micros": 0,
      "unpriced_tokens": 0
    },
    "write_12h": {
      "tokens": 0,
      "rate_cents_per_million": 0,
      "provider_cost_micros": 0,
      "unpriced_tokens": 0
    },
    "write_total_tokens": 0,
    "per_type_available": true,
    "records_without_audit_detail": 0
  }
}
401 Missing or invalid bearer token.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

403 Error response.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

429 The request was rate limited. API-generated responses are JSON;

Response headers

  • Retry-After string header

    Seconds to wait before retrying, when provided.

  • X-RateLimit-Scope string header

    Identifies the scope of the request limit, when provided.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

text/html string