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

# Track Resource Cost and Monthly Spend in Springwinter

> See real-time cost estimates and projected monthly run rates for each resource, sourced from AWS Cost Explorer running in your own AWS account.

Springwinter shows a real-time cost estimate and a projected monthly run rate for each resource you deploy. These estimates come from AWS Cost Explorer using the IAM role in your account, so the figures reflect your actual AWS pricing tier, reserved capacity, and any applicable discounts — not generic list prices.

## What You See in the Dashboard

Every resource detail page includes a **Cost** section with two figures:

<CardGroup cols={2}>
  <Card title="Month-to-Date Spend" icon="receipt">
    The estimated amount this resource has cost since the start of the current calendar month, pulled from AWS Cost Explorer.
  </Card>

  <Card title="Monthly Run Rate" icon="chart-line">
    The projected cost for a full month if the resource continues running at its current size and utilization.
  </Card>
</CardGroup>

Use the monthly run rate to make right-sizing decisions before they become a billing surprise. If a worker is using 5 % of its allocated memory, you can reduce its task definition size and see the projected saving immediately.

## Cost API

Fetch cost estimates programmatically to build internal dashboards, budget alerts, or cost allocation reports.

<Tabs>
  <Tab title="Web Servers">
    ```bash theme={null}
    curl https://springwinter.dev/api/projects/{project_id}/web_servers/{id}/cost \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>

  <Tab title="Workers">
    ```bash theme={null}
    curl https://springwinter.dev/api/projects/{project_id}/workers/{id}/cost \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>

  <Tab title="Static Websites">
    ```bash theme={null}
    curl https://springwinter.dev/api/projects/{project_id}/static_websites/{id}/cost \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>

  <Tab title="Caches">
    ```bash theme={null}
    curl https://springwinter.dev/api/projects/{project_id}/redis/{id}/cost \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>

  <Tab title="Storage">
    ```bash theme={null}
    curl https://springwinter.dev/api/projects/{project_id}/storage/{id}/cost \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```
  </Tab>
</Tabs>

### Cost API Reference

<AccordionGroup>
  <Accordion title="GET /api/projects/{project_id}/web_servers/{id}/cost">
    Returns the month-to-date cost estimate and projected monthly run rate for the specified web server, sourced from AWS Cost Explorer.

    <ParamField path="project_id" type="string" required>
      The unique identifier of the project that owns the web server.
    </ParamField>

    <ParamField path="id" type="string" required>
      The unique identifier of the web server resource.
    </ParamField>
  </Accordion>

  <Accordion title="GET /api/projects/{project_id}/workers/{id}/cost">
    Returns cost data for the specified worker.

    <ParamField path="project_id" type="string" required>
      The unique identifier of the project that owns the worker.
    </ParamField>

    <ParamField path="id" type="string" required>
      The unique identifier of the worker resource.
    </ParamField>
  </Accordion>

  <Accordion title="GET /api/projects/{project_id}/static_websites/{id}/cost">
    Returns cost data for the specified static website, covering CloudFront distribution and S3 storage charges.

    <ParamField path="project_id" type="string" required>
      The unique identifier of the project that owns the static website.
    </ParamField>

    <ParamField path="id" type="string" required>
      The unique identifier of the static website resource.
    </ParamField>
  </Accordion>

  <Accordion title="GET /api/projects/{project_id}/redis/{id}/cost">
    Returns cost data for the specified Valkey/Redis-compatible cache.

    <ParamField path="project_id" type="string" required>
      The unique identifier of the project that owns the cache.
    </ParamField>

    <ParamField path="id" type="string" required>
      The unique identifier of the cache resource.
    </ParamField>
  </Accordion>

  <Accordion title="GET /api/projects/{project_id}/storage/{id}/cost">
    Returns a cost link for the specified private S3 storage bucket. Follow the returned link to view detailed cost breakdowns in AWS Cost Explorer.

    <ParamField path="project_id" type="string" required>
      The unique identifier of the project that owns the storage bucket.
    </ParamField>

    <ParamField path="id" type="string" required>
      The unique identifier of the storage resource.
    </ParamField>
  </Accordion>
</AccordionGroup>

## Reducing Costs

<Tip>
  The two most effective ways to lower your AWS bill are right-sizing ECS task definitions and deleting resources you no longer use. Reduce the CPU and memory allocated to a web server or worker to match actual utilization shown in the Metrics tab, then check the updated run-rate estimate to confirm the saving.
</Tip>

## Important Notes on Cost Data

<Warning>
  Cost figures shown in Springwinter are estimates from AWS Cost Explorer. Your actual AWS bill — visible in the AWS Billing and Cost Management console — is the authoritative source of charges. Small discrepancies can occur due to Cost Explorer's data refresh latency and estimate methodology.
</Warning>

<Note>
  AWS charges for all resources are billed directly to your AWS account. Springwinter does not add a markup on AWS resource costs — you pay AWS list prices (or your negotiated rates) with no intermediary.
</Note>
