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

# Get Cache Statistics

> Get cache hit rate and usage statistics for sandbox code execution results using the HopX VM Agent API. Monitor cache performance, view hit rates, and track cached items to optimize execution speed. Learn how to use GET /cache/stats endpoint to retrieve cache statistics. Includes request examples and performance metrics.

Get the VM agent status, version, and basic health information. This endpoint provides agent metadata rather than cache statistics.

<Note>
  For clearing the execution cache, use the [Clear Cache](/api/vm-agent/clear-cache) endpoint.
</Note>

## Endpoint

```
GET /cache
```

## Request

### Headers

```
Authorization: Bearer YOUR_JWT_TOKEN
```

### Example Request

```bash theme={null}
curl https://sandbox_abc123xyz.hopx.dev/cache \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
```

## Response

### Success (200 OK)

```json theme={null}
{
  "agent": "HopX VM Agent (Go)",
  "status": "running",
  "version": "3.2.8",
  "vm_id": "17633354502w4l8eiy",
  "message": "success",
  "timestamp": "2025-11-16T23:25:45Z"
}
```

### Response Fields

| Field       | Type   | Description                     |
| ----------- | ------ | ------------------------------- |
| `agent`     | string | Agent name and runtime          |
| `status`    | string | Agent status (running, stopped) |
| `version`   | string | Agent version                   |
| `vm_id`     | string | Sandbox/VM identifier           |
| `message`   | string | Status message                  |
| `timestamp` | string | Response timestamp (ISO 8601)   |

## Status Codes

| Code | Description  |
| ---- | ------------ |
| 200  | Success      |
| 401  | Unauthorized |

## Use Cases

### Check Agent Status

```bash theme={null}
curl https://sandbox_abc123xyz.hopx.dev/cache \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" | \
  jq '{agent, status, version}'
```

### Verify Agent Version

```bash theme={null}
VERSION=$(curl -s https://sandbox_abc123xyz.hopx.dev/cache \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" | jq -r '.version')

echo "Agent version: $VERSION"
```

### Monitor Agent Health

```bash theme={null}
STATUS=$(curl -s https://sandbox_abc123xyz.hopx.dev/cache \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" | jq -r '.status')

if [ "$STATUS" == "running" ]; then
  echo "✅ Agent is healthy"
else
  echo "⚠️ Agent status: $STATUS"
fi
```

## Related

* **SDK**: [sandbox.cache.stats()](/sdk/python/cache#stats) - Python SDK method
* [CLI System Commands](/cli/commands/system) - System operations from CLI

## Next Steps

* **[Clear Cache](/api/vm-agent/clear-cache)** - Clear execution cache
* **[Get System Metrics](/api/vm-agent/get-system-metrics)** - View resource usage
