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

# Monitor Cloud Costs with AI Agents

> Use MCP tools to check your balance, get spending breakdowns, identify expensive instances, and tear down idle resources — all through conversation.

export const RuncrateStyles = () => {
  if (typeof document !== 'undefined' && !document.getElementById('runcrate-overrides')) {
    const s = document.createElement('style');
    s.id = 'runcrate-overrides';
    s.textContent = `
      /* Match Runcrate's rounding scale (--radius: 0.75rem) */
      .rounded-sm { border-radius: 0.5rem !important; }   /* 8px */
      .rounded-md { border-radius: 0.625rem !important; } /* 10px */
      .rounded-lg { border-radius: 0.75rem !important; }  /* 12px */
      .rounded-l-sm { border-top-left-radius: 0.5rem !important; border-bottom-left-radius: 0.5rem !important; }
      .rounded-r-sm { border-top-right-radius: 0.5rem !important; border-bottom-right-radius: 0.5rem !important; }
      .rounded-l-md { border-top-left-radius: 0.625rem !important; border-bottom-left-radius: 0.625rem !important; }
      .rounded-r-md { border-top-right-radius: 0.625rem !important; border-bottom-right-radius: 0.625rem !important; }
      .rounded-l-lg { border-top-left-radius: 0.75rem !important; border-bottom-left-radius: 0.75rem !important; }
      .rounded-r-lg { border-top-right-radius: 0.75rem !important; border-bottom-right-radius: 0.75rem !important; }

      /* Cards: never pure white in light mode */
      .card { background-color: #fcfcfc !important; border-radius: 0.75rem !important; }
      html.dark .card { background-color: #141414 !important; }

      /* Docs hero box */
      .rc-hero { background-color: #fcfcfc; border: 1px solid #e0e0e0; }
      html.dark .rc-hero { background-color: #141414; border-color: #242424; }
      html.dark .rc-hero h1 { color: #f5f5f5; }

      /* Runcrate scrollbar — thin, transparent track, hide-until-hover thumb */
      ::-webkit-scrollbar { width: 6px; height: 6px; background-color: transparent; }
      ::-webkit-scrollbar-track { background-color: transparent; }
      ::-webkit-scrollbar-thumb { background-color: rgba(155, 155, 155, 0.5); border-radius: 10px; transition: opacity 0.3s ease; opacity: 0; }
      ::-webkit-scrollbar-thumb:hover { background-color: rgba(155, 155, 155, 0.7); }
      *:hover::-webkit-scrollbar-thumb,
      *:focus::-webkit-scrollbar-thumb,
      *:active::-webkit-scrollbar-thumb { opacity: 1; }
      * { scrollbar-width: thin; scrollbar-color: rgba(155, 155, 155, 0.5) transparent; }
    `;
    document.head.appendChild(s);
  }
  return null;
};

<RuncrateStyles />

Keep cloud spending under control without opening the dashboard. Your AI agent can check balances, break down usage, identify waste, and terminate idle resources.

***

## "How much have I spent this week and what's my balance?"

The agent checks billing:

1. **`billing_balance`** — returns current credit balance
2. **`billing_usage`** — returns spending breakdown for the last 7 days

> **Current balance:** \$487.30
>
> **Last 7 days spending: \$112.70**
>
> | Resource              | Hours   | Cost    |
> | --------------------- | ------- | ------- |
> | inference-prod (H100) | 168 hrs | \$84.00 |
> | training-v3 (A100)    | 12 hrs  | \$19.20 |
> | dev-box (RTX 4090)    | 22 hrs  | \$7.70  |
> | Storage (3 volumes)   | —       | \$1.80  |
>
> Your H100 inference server accounts for 75% of your spend. It's been running 24/7.
> At this rate, your balance covers another \~30 days.

***

## "Find anything that's running but not being used and shut it down."

The agent cross-references instance status with GPU utilization:

1. **`list_instances`** — gets all running instances
2. **`ssh_execute`** — checks `nvidia-smi` on each running instance
3. **`billing_usage`** — calculates cost per instance

> Checked 4 running instances:
>
> | Instance       | GPU      | Utilization | Running | Cost so far |
> | -------------- | -------- | ----------- | ------- | ----------- |
> | inference-prod | H100     | 42%         | 7 days  | \$84.00     |
> | training-v3    | A100     | 95%         | 12 hrs  | \$19.20     |
> | dev-box        | RTX 4090 | 0%          | 8 hrs   | \$2.80      |
> | test-bench     | RTX 4090 | 0%          | 14 hrs  | \$4.90      |
>
> **dev-box** and **test-bench** have 0% GPU utilization. Together they're burning \$0.70/hr.
> Want me to terminate both?

After you confirm:

4. **`delete_instance`** — terminates `dev-box`
5. **`delete_instance`** — terminates `test-bench`

> Terminated **dev-box** and **test-bench**. Saving $0.70/hr ($16.80/day).

***

## "Give me a monthly projection. Can I afford to run an H100 for the rest of the month?"

The agent calculates:

1. **`billing_balance`** — checks current balance
2. **`billing_usage`** — gets daily burn rate from the last 30 days
3. **`list_instances`** — gets current active instances and their per-hour cost

> **Balance:** $487.30 **Current burn rate:** $2.50/hr (inference-prod H100) + $1.60/hr (training-v3 A100) = **$4.10/hr\*\*
>
> At \$4.10/hr, you have **\~119 hours** (\~5 days) of runway.
>
> If you shut down the A100 after training completes (\~6 more hours), the H100 alone burns \$2.50/hr — that gives you **\~192 hours** (\~8 days).
>
> To run the H100 for the remaining 12 days of the month, you'd need \~$720 in credits. You're **$233 short\*\*. Options:
>
> 1. Add \$250 in credits from the dashboard
> 2. Switch to an A100 for inference (\$1.60/hr) — covers the full month

***

## Tools used in this workflow

| Tool              | Purpose                                       |
| ----------------- | --------------------------------------------- |
| `billing_balance` | Check current credit balance                  |
| `billing_usage`   | Get spending breakdown by resource and period |
| `list_instances`  | Identify all running resources                |
| `ssh_execute`     | Check GPU utilization to find idle instances  |
| `delete_instance` | Terminate idle resources to stop spending     |
