Skip to main content
MeshAI’s ML engine runs four detection algorithms every 5 minutes: cost spikes, reliability decay, behavioral drift, and security threats. Detected anomalies are surfaced via the SDK and dashboard.

list_anomalies()

List anomalies for your tenant, optionally filtered by status, type, or agent.
anomalies = client.list_anomalies(
    status="open",
    anomaly_type="cost_spike",
    agent_id="agt_abc123",
    limit=20,
)
status
string
Filter by status: open, acknowledged, resolved
anomaly_type
string
Filter by type: cost_spike, reliability_decay, behavioral_drift, security_threat
agent_id
string
Filter by agent ID
limit
integer
default:"20"
Results per page
offset
integer
default:"0"
Results to skip
Returns:
[
  {
    "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
    }
  }
]

get_anomaly()

Get a single anomaly by ID.
anomaly = client.get_anomaly("ano_abc123")
anomaly_id
string
required
Anomaly ID

acknowledge_anomaly()

Mark an anomaly as acknowledged. This indicates a human has reviewed it.
client.acknowledge_anomaly(
    "ano_abc123",
    note="Expected spike — batch processing job ran today",
)
anomaly_id
string
required
Anomaly ID
note
string
Optional note explaining the acknowledgment

resolve_anomaly()

Mark an anomaly as resolved.
client.resolve_anomaly(
    "ano_abc123",
    resolution="Batch job completed. Cost will return to normal tomorrow.",
)
anomaly_id
string
required
Anomaly ID
resolution
string
Description of how the anomaly was resolved

get_anomaly_summary()

Get a summary of anomaly counts by type and status.
summary = client.get_anomaly_summary()
Returns:
{
  "total": 12,
  "by_status": {
    "open": 3,
    "acknowledged": 5,
    "resolved": 4
  },
  "by_type": {
    "cost_spike": 6,
    "reliability_decay": 3,
    "behavioral_drift": 2,
    "security_threat": 1
  }
}