# Monitor Usage and Costs

Track your agent's resource consumption and AIOU spending.

## Accessing Usage

Navigate to **Usage** in the sidebar.

## Usage Dashboard

```
┌─────────────────────────────────────┐
│ Usage                          📊   │
├─────────────────────────────────────┤
│                                     │
│  Resource Usage        Last 24h     │
│  ┌──────────┐ ┌──────────┐         │
│  │ CPU      │ │ Memory   │         │
│  │ 45% avg  │ │ 2.1GB    │         │
│  └──────────┘ └──────────┘         │
│                                     │
│  API Calls                          │
│  Total: 1,234    Cost: 0.45 AIOU   │
│                                     │
│  [Chart: Usage over time]           │
│                                     │
└─────────────────────────────────────┘
```

## Metrics Tracked

### System Resources

| Metric      | Description       | Alert Threshold |
| ----------- | ----------------- | --------------- |
| **CPU**     | Processor usage % | 80% warning     |
| **Memory**  | RAM consumption   | 85% warning     |
| **Disk**    | Storage used      | 90% warning     |
| **Network** | Data transfer     | Varies          |

### API Usage

| Metric       | Description             |
| ------------ | ----------------------- |
| **Requests** | Total API calls         |
| **Tokens**   | LLM input/output tokens |
| **Cost**     | AIOU spent on API       |
| **Latency**  | Average response time   |

## Time Ranges

View usage for different periods:

| Range            | Use Case              |
| ---------------- | --------------------- |
| **Last Hour**    | Recent activity spike |
| **Last 24h**     | Daily patterns        |
| **Last 7 Days**  | Weekly trends         |
| **Last 30 Days** | Monthly analysis      |
| **Custom**       | Specific date range   |

## Understanding Charts

### Resource Graphs

Visualize over time:

* CPU usage spikes
* Memory growth
* Disk filling up

### Cost Breakdown

See spending by category:

```
VPS Hosting:    1.20 AIOU (80%)
LLM API:        0.30 AIOU (20%)
────────────────────────────
Total:          1.50 AIOU
```

### API Call Analysis

| Model             | Calls | Tokens | Cost |
| ----------------- | ----- | ------ | ---- |
| deepseek-chat     | 1,000 | 500K   | 0.21 |
| deepseek-reasoner | 50    | 100K   | 0.09 |

## Cost Alerts

### Setting Thresholds

Configure in **Settings** or **Config**:

```yaml
usage_alerts:
  daily_spend_limit: 5.0  # AIOU
  alert_at_percent: 80    # % of limit
  notify_channels:
    - telegram
    - email
```

### Alert Types

| Alert           | Trigger                    |
| --------------- | -------------------------- |
| **Daily Limit** | Spending exceeds threshold |
| **High CPU**    | Sustained high usage       |
| **Low Balance** | Agent wallet running low   |
| **API Error**   | Repeated failed calls      |

## Optimization Insights

### High VPS Usage

Possible causes:

* Resource class too small
* Infinite loops in code
* Memory leaks

Actions:

* Upgrade resource class
* Review agent logic
* Restart agent

### High API Costs

Possible causes:

* Excessive LLM calls
* Long conversations
* Expensive models

Actions:

* Optimize prompts
* Use cheaper models
* Cache responses

### Disk Space

If disk filling:

* Review log retention
* Clean up temp files
* Archive old data

## Exporting Data

### CSV Export

Download usage data:

```
Usage → Export → CSV
```

Columns:

* Timestamp
* Metric name
* Value
* Cost

### API Access

Programmatic access:

```bash
curl https://claw-api.agos.fun/v1/usage \
  -H "Authorization: Bearer $API_KEY"
```

## Comparing Periods

Compare usage week-over-week:

```
This Week:  45 AIOU
Last Week:  38 AIOU
Change:     +18%
```

Identify trends and anomalies.

## Troubleshooting

### No Data Showing

* Check time range selection
* Verify agent was running
* Refresh page

### Discrepancies

* Compare with History section
* Check if multiple agents
* Verify timezone

### High Costs

* Review [Understanding Costs](/agos/agos-cloud/platform/costs.md)
* Check for runaway processes
* Optimize resource class

## Best Practices

✅ **Do**:

* Review usage weekly
* Set cost alerts
* Track cost per task
* Optimize based on data

❌ **Don't**:

* Ignore cost trends
* Run without limits
* Forget to check disk space

## Next Steps

→ [View Logs and Debug](/agos/agos-cloud/agent/logs-debug.md) for troubleshooting


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://agos.gitbook.io/agos/agos-cloud/agent/usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
