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

# Get Billing Projection V1

> Linear projection of end-of-period spend given current burn rate…

Linear projection of end-of-period spend given current burn rate.

Lets tenants spot a runaway month early — 'we're 3 days in and the
projection says we'll hit \$850 by month-end, time to investigate.'
Naive: just extrapolates the average daily cost. Doesn't model
weekends, demand spikes, or seasonal patterns.

### Response

`BillingProjectionResponse`

<ResponseField name="period_start" type="string,null">
  ISO 8601 of the billing period's start. None when no subscription is on file.
</ResponseField>

<ResponseField name="period_end" type="string,null">
  ISO 8601 of the billing period's end.
</ResponseField>

<ResponseField name="days_elapsed" type="number" required>
  Decimal days from period\_start to now, capped at the period length.
</ResponseField>

<ResponseField name="days_remaining" type="number" required />

<ResponseField name="period_cost_so_far" type="number" required />

<ResponseField name="daily_burn_rate" type="number" required>
  period\_cost\_so\_far / max(days\_elapsed, 1). USD/day.
</ResponseField>

<ResponseField name="projected_period_total" type="number" required>
  Linear extrapolation: cost\_so\_far + (daily\_burn\_rate × days\_remaining). Naive — does not model end-of-month spikes or weekend tapering.
</ResponseField>

<ResponseField name="projection_basis" type="string" required>
  `actual` when we have a real period and at least some elapsed time; `no_subscription` when no subscription row exists; `no_window` when a subscription exists but has no billing\_period\_start/end (yet to be set by Stripe sync).
</ResponseField>

### Status codes

| Code  | Meaning             |
| ----- | ------------------- |
| `200` | Successful Response |

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.computer.stateset.app/api/v1/billing/projection' \
    --header 'X-API-Key: YOUR_API_KEY'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "period_start": "string",
    "period_end": "string",
    "days_elapsed": 1.5,
    "days_remaining": 1.5,
    "period_cost_so_far": 1.5,
    "daily_burn_rate": 7.5,
    "projected_period_total": 49,
    "projection_basis": "actual"
  }
  ```
</ResponseExample>
