{
  "suite": "open-cost-read-api-response",
  "version": "0.1.0",
  "schema": "https://vibecosts.app/cost-api/schema",
  "canonical_spec": "https://vibecosts.app/cost-api/spec",
  "openapi": "https://vibecosts.app/cost-api/openapi",
  "purpose": "Portable, complete response cases. Vibe Costs CI compiles the published JSON Schema and proves that every valid case passes and every invalid case fails.",
  "scope": "Response shape only. OAuth behavior, provider calculation accuracy, freshness, finalization, revocation, and ISO 4217 assignment are reviewed separately during a pilot.",
  "cases": [
    {
      "id": "core-current-period-total",
      "valid": true,
      "level": "core-response",
      "description": "Smallest useful open-period response when item attribution is unavailable.",
      "response": {
        "cost_account_id": "acct_123",
        "billing_currency": "USD",
        "period_start": "2026-08-01T00:00:00Z",
        "period_end": "2026-08-21T00:00:00Z",
        "cost_status": "estimated",
        "billed_cost": "37.37",
        "updated_at": "2026-08-21T13:45:00Z",
        "items": []
      }
    },
    {
      "id": "detailed-credit",
      "valid": true,
      "level": "detailed-response",
      "description": "Invoice-basis billed cost preserves a signed credit without claiming amortized EffectiveCost.",
      "response": {
        "cost_account_id": "acct_123",
        "billing_currency": "USD",
        "period_start": "2026-07-01T00:00:00Z",
        "period_end": "2026-08-01T00:00:00Z",
        "cost_status": "final",
        "credits": "-5.00",
        "billed_cost": "37.37",
        "updated_at": "2026-08-03T09:10:00Z",
        "items": [
          {
            "charge_period_start": "2026-07-01T00:00:00Z",
            "charge_period_end": "2026-08-01T00:00:00Z",
            "service_name": "Build",
            "resource_id": "project_abc",
            "consumed_quantity": "18",
            "consumed_unit": "build minute",
            "list_cost": "42.37",
            "credits": "-5.00",
            "billed_cost": "37.37"
          }
        ]
      }
    },
    {
      "id": "detailed-focus-effective-cost",
      "valid": true,
      "level": "detailed-response",
      "description": "Optional EffectiveCost is present only with its FOCUS amortized-cost meaning.",
      "response": {
        "cost_account_id": "acct_commitment",
        "billing_currency": "USD",
        "period_start": "2026-07-01T00:00:00Z",
        "period_end": "2026-08-01T00:00:00Z",
        "cost_status": "final",
        "billed_cost": "120.00",
        "effective_cost": "100.00",
        "updated_at": "2026-08-03T09:10:00Z",
        "items": []
      }
    },
    {
      "id": "invalid-json-number-for-money",
      "valid": false,
      "description": "Money must be a base-10 JSON string, not a JSON number.",
      "response": {
        "cost_account_id": "acct_123",
        "billing_currency": "USD",
        "period_start": "2026-08-01T00:00:00Z",
        "period_end": "2026-08-21T00:00:00Z",
        "cost_status": "estimated",
        "billed_cost": 37.37,
        "updated_at": "2026-08-21T13:45:00Z",
        "items": []
      }
    },
    {
      "id": "invalid-non-utc-timestamp",
      "valid": false,
      "description": "The profile normalizes timestamps to the RFC 3339 UTC Z designator.",
      "response": {
        "cost_account_id": "acct_123",
        "billing_currency": "USD",
        "period_start": "2026-08-01T00:00:00Z",
        "period_end": "2026-08-21T00:00:00Z",
        "cost_status": "estimated",
        "billed_cost": "37.37",
        "updated_at": "2026-08-21T09:45:00-04:00",
        "items": []
      }
    },
    {
      "id": "invalid-missing-charge-period",
      "valid": false,
      "description": "Every attributed item identifies its charge interval.",
      "response": {
        "cost_account_id": "acct_123",
        "billing_currency": "USD",
        "period_start": "2026-08-01T00:00:00Z",
        "period_end": "2026-08-21T00:00:00Z",
        "cost_status": "estimated",
        "billed_cost": "37.37",
        "updated_at": "2026-08-21T13:45:00Z",
        "items": [
          {
            "service_name": "Build",
            "billed_cost": "6.20"
          }
        ]
      }
    },
    {
      "id": "invalid-unknown-field",
      "valid": false,
      "description": "Unversioned fields are rejected instead of being silently misinterpreted.",
      "response": {
        "cost_account_id": "acct_123",
        "billing_currency": "USD",
        "period_start": "2026-08-01T00:00:00Z",
        "period_end": "2026-08-21T00:00:00Z",
        "cost_status": "estimated",
        "billed_cost": "37.37",
        "updated_at": "2026-08-21T13:45:00Z",
        "items": [],
        "total": "37.37"
      }
    },
    {
      "id": "invalid-empty-account-id",
      "valid": false,
      "description": "The selected provider cost account must have a nonempty opaque identifier.",
      "response": {
        "cost_account_id": "",
        "billing_currency": "USD",
        "period_start": "2026-08-01T00:00:00Z",
        "period_end": "2026-08-21T00:00:00Z",
        "cost_status": "estimated",
        "billed_cost": "37.37",
        "updated_at": "2026-08-21T13:45:00Z",
        "items": []
      }
    },
    {
      "id": "invalid-empty-page-token",
      "valid": false,
      "description": "An emitted continuation token must be nonempty.",
      "response": {
        "cost_account_id": "acct_123",
        "billing_currency": "USD",
        "period_start": "2026-08-01T00:00:00Z",
        "period_end": "2026-08-21T00:00:00Z",
        "cost_status": "estimated",
        "billed_cost": "37.37",
        "updated_at": "2026-08-21T13:45:00Z",
        "items": [],
        "next_page_token": ""
      }
    }
  ]
}
