List Anomalies
GET /anomalies
| Parameter | Type | Description |
|---|---|---|
status | string | open, acknowledged, resolved |
type | string | cost_spike, reliability_decay, behavioral_drift, security_threat |
agent_id | string | Filter to a specific agent |
severity | string | low, medium, high, critical |
page | integer | Page number |
limit | integer | Results per page |
curl "https://api.meshai.dev/api/v1/anomalies?status=open&type=cost_spike" \
-H "Authorization: Bearer msh_YOUR_API_KEY"
{
"success": true,
"data": [
{
"id": "ano_abc123",
"agent_id": "agt_xyz789",
"agent_name": "production-summarizer",
"anomaly_type": "cost_spike",
"severity": "high",
"status": "open",
"description": "Token spend increased 340% vs 7-day average",
"detected_at": "2026-03-17T09:45:00Z",
"details": {
"current_cost_usd": 45.20,
"baseline_cost_usd": 10.30,
"deviation_percent": 338.8
}
}
],
"meta": { "total": 3, "page": 1, "limit": 20 }
}
Get an Anomaly
GET /anomalies/{anomaly_id}
curl https://api.meshai.dev/api/v1/anomalies/ano_abc123 \
-H "Authorization: Bearer msh_YOUR_API_KEY"
Anomaly Summary
GET /anomalies/summary
curl https://api.meshai.dev/api/v1/anomalies/summary \
-H "Authorization: Bearer msh_YOUR_API_KEY"
{
"success": true,
"data": {
"total": 12,
"by_status": { "open": 3, "acknowledged": 5, "resolved": 4 },
"by_type": {
"cost_spike": 6,
"reliability_decay": 3,
"behavioral_drift": 2,
"security_threat": 1
}
}
}
Acknowledge an Anomaly
POST /anomalies/{anomaly_id}/acknowledge
curl -X POST https://api.meshai.dev/api/v1/anomalies/ano_abc123/acknowledge \
-H "Authorization: Bearer msh_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "note": "Expected spike, batch processing job" }'
Resolve an Anomaly
POST /anomalies/{anomaly_id}/resolve
curl -X POST https://api.meshai.dev/api/v1/anomalies/ano_abc123/resolve \
-H "Authorization: Bearer msh_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "resolution": "Batch job completed. Cost back to normal." }'
Anomaly Rules
Custom rules let you define thresholds and conditions for anomaly detection beyond the built-in ML algorithms.List Rules
GET /anomaly-rules
curl https://api.meshai.dev/api/v1/anomaly-rules \
-H "Authorization: Bearer msh_YOUR_API_KEY"
Create a Rule
POST /anomaly-rules
| Field | Type | Description |
|---|---|---|
anomaly_type | string | cost_spike, reliability_decay, behavioral_drift, security_threat |
enabled | boolean | Defaults to true |
threshold_config | object | Threshold parameters for the rule |
notification_config | object | Optional. Set webhook_url to receive delivery notifications |
curl -X POST https://api.meshai.dev/api/v1/anomaly-rules \
-H "Authorization: Bearer msh_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"anomaly_type": "cost_spike",
"enabled": true,
"threshold_config": { "daily_cost_usd": 100 },
"notification_config": { "webhook_url": "https://example.com/webhooks/meshai" }
}'
{
"success": true,
"data": {
"id": 12,
"anomaly_type": "cost_spike",
"enabled": true,
"threshold_config": { "daily_cost_usd": 100 },
"notification_config": { "webhook_url": "https://example.com/webhooks/meshai" },
"created_at": "2026-03-17T10:00:00Z",
"updated_at": "2026-03-17T10:00:00Z"
}
}
Update a Rule
PATCH /anomaly-rules/{rule_id}
curl -X PATCH https://api.meshai.dev/api/v1/anomaly-rules/12 \
-H "Authorization: Bearer msh_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "threshold_config": { "daily_cost_usd": 150 } }'
Delete a Rule
DELETE /anomaly-rules/{rule_id}
curl -X DELETE https://api.meshai.dev/api/v1/anomaly-rules/12 \
-H "Authorization: Bearer msh_YOUR_API_KEY"

