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

# Monitor Usage & Costs

> See how much your project is spending on AI, hosting, storage, and bandwidth

Every Hiveku project has a Usage page showing real-time costs broken down by resource — AI tokens, Lambda invocations, S3 storage, CloudFront bandwidth, and more. Good for catching runaway costs early and knowing what to optimize.

```
Project > Usage
```

## The Three Tabs

* **Overview** — cost breakdown by resource this billing period
* **AI** — AI-specific usage with per-model and per-mode breakdown
* **Infrastructure** — time-series trends for Lambda, bandwidth, cost

## Overview Tab

Lists each underlying AWS or platform resource your project is using:

| Resource            | What's measured                                 |
| ------------------- | ----------------------------------------------- |
| **Lambda**          | Function invocations + duration + cost          |
| **S3**              | Storage size + request count + bandwidth + cost |
| **CloudFront**      | CDN requests + data transfer + cost             |
| **ACM**             | SSL certificate count + cost                    |
| **Secrets Manager** | Secret count + cost                             |
| **Database**        | Active connections + storage used               |

A **Total** row sums project cost for the current billing period.

## AI Tab

Where most surprise costs come from — LLM tokens add up fast.

The AI tab shows:

* **Total AI cost** and total tokens used this period
* **Breakdown by model** — Hiveku Mini, Max, Ultra (or the underlying provider names if you're using BYOK)
* **Breakdown by mode** — Code, Designer, Debug, etc. — so you can see which workflows cost the most
* **Recent sessions** — a table with session ID, user, cost, tokens, and timestamp

<Tip>
  If your AI costs spike, check the **Recent Sessions** table. It shows the exact prompt and user that drove usage. Often one runaway agent loop or a user pasting huge context accounts for most of a spike. Switch that workflow to Hiveku Mini for simple tasks.
</Tip>

## Infrastructure Tab

Time-series view for trends, not just current totals:

* **7-day** or **30-day** toggle at the top
* **Lambda duration trend** — is your code getting slower?
* **Bandwidth trend** — are you getting more traffic or bigger assets?
* **Cost trend over time** — day-over-day and period-over-period

Helpful for spotting gradual creep — a page that's 2x the size now as it was a month ago, or a function whose execution time drifted up.

## Cached vs. Fresh Data

The Usage page caches data for a short window to keep the dashboard fast. Click **Refresh** in the top right to force a fresh fetch from AWS and the billing service.

<Info>
  Per-project usage here doesn't replace account-level billing. For invoices, payment methods, and plan management, go to **Settings > Billing** in the top nav.
</Info>

## Using Usage to Optimize

A few practical things you can do after looking at Usage:

<Steps>
  <Step title="Identify the biggest line item">
    Open Overview. Sort by cost descending. Your biggest line is where optimization pays off most.
  </Step>

  <Step title="If AI dominates, check modes">
    Open AI tab. If Code mode on Hiveku Ultra is dominating, see if Hiveku Mini handles the simpler tasks well enough.
  </Step>

  <Step title="If bandwidth dominates, compress assets">
    Check asset sizes in Content > Assets. Images over 500KB are usually over-sized for web. Hiveku auto-optimizes images but custom uploads can slip through.
  </Step>

  <Step title="If Lambda duration creeps up, profile">
    Infrastructure tab's Lambda trend shows duration. If it's rising, a slow dependency or growing data set is the cause.
  </Step>
</Steps>

## Verifying the Numbers

<Steps>
  <Step title="Compare to the invoice">
    Go to **Settings > Billing** (account-level). Compare this month's usage totals to what's on your invoice.
  </Step>

  <Step title="Account for timing">
    Usage in the Usage page is real-time. Invoices bill on a fixed period (monthly, typically). Numbers may not match exactly mid-period.
  </Step>

  <Step title="Check for AI BYOK">
    If you've brought your own LLM keys, some AI usage is charged directly to your provider (Anthropic, OpenAI) and not to Hiveku. See [BYOK AI](/how-tos/byok-ai).
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Data feels stale">
    Click **Refresh** in the top right. The cache TTL is a few minutes — refresh forces a live fetch. If it's still not updating, the upstream billing service may be lagging; try again in 15 minutes.
  </Accordion>

  <Accordion title="Costs here don't match my monthly invoice">
    Usage is real-time; invoices are billed at period close. Timing differences are normal mid-month. At period close, numbers should reconcile. If they don't, open a support ticket — include screenshots of both numbers.
  </Accordion>

  <Accordion title="Infrastructure tab is empty">
    The project hasn't deployed yet (or hasn't had traffic). Infrastructure metrics only start filling in after your first deploy and some real visits.
  </Accordion>

  <Accordion title="AI tab shows zero but I've been using the AI">
    If you have BYOK enabled, AI calls route to your provider and don't show in Hiveku's metering. Your costs appear on your Anthropic/OpenAI dashboard instead. See [BYOK AI](/how-tos/byok-ai).
  </Accordion>

  <Accordion title="One resource line looks wildly high">
    Check the Recent Sessions (AI) or drill into the specific resource. A single runaway agent loop or a misconfigured cron job can account for 90% of a month's cost. Pause the culprit and contact support if it was caused by a platform issue.
  </Accordion>
</AccordionGroup>

## What's Next?

<CardGroup cols={2}>
  <Card title="BYOK AI" icon="key" href="/how-tos/byok-ai">
    Bring your own LLM keys to control AI costs separately
  </Card>

  <Card title="Switch Between Accounts" icon="right-left" href="/how-tos/switch-accounts">
    Check usage across your different client accounts
  </Card>
</CardGroup>
