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

# Monitoring API

> Fleet-wide status overview and per-agent health scores

## Fleet Overview

```
GET /monitoring/overview
```

Returns the count of agents in each status across the tenant.

```bash theme={null}
curl https://api.meshai.dev/api/v1/monitoring/overview \
  -H "Authorization: Bearer msh_YOUR_API_KEY"
```

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "total_agents": 12,
      "healthy": 9,
      "degraded": 2,
      "down": 1,
      "unknown": 0
    }
  }
  ```
</ResponseExample>

## Agent Health Score

```
GET /agents/{agent_id}/health
```

Returns a composite health score (0-100) for a single agent, broken down into reliability, cost efficiency, and performance components. Backed by a 5-minute Redis cache; `cached` indicates whether the score was served from cache or computed fresh.

```bash theme={null}
curl https://api.meshai.dev/api/v1/agents/01HQZXK3VJ3XZ9K8QYNPBC7G4T/health \
  -H "Authorization: Bearer msh_YOUR_API_KEY"
```

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "agent_id": "01HQZXK3VJ3XZ9K8QYNPBC7G4T",
      "score": 87,
      "color": "green",
      "breakdown": {
        "reliability": {
          "score": 92,
          "weight": 0.4,
          "details": { "error_rate": 0.02, "uptime_pct": 99.1 }
        },
        "cost_efficiency": {
          "score": 80,
          "weight": 0.3,
          "details": { "daily_cost_trend": -0.05 }
        },
        "performance": {
          "score": 85,
          "weight": 0.3,
          "details": { "avg_latency_ms": 340.2, "p95_latency_ms": 890.5 }
        }
      },
      "computed_at": "2026-03-17T10:30:00Z",
      "cached": false
    }
  }
  ```
</ResponseExample>

Returns `404 Not Found` if the agent does not exist in the tenant.
