Public API
Integrate MeshInfer monitoring with external services. Fetch metrics, manage alerts, and schedule maintenance.
Authentication
All API requests require a Bearer token. Include your API key in the Authorization header:
Authorization: Bearer pk_live_your_api_key_here
API keys start with pk_. Generate one in your account settings.
GET /api/v1/metrics
Fetch aggregated monitoring metrics for the last N days.
Query Parameters
periodhourly | daily | monthly (default: hourly)daysNumber of days to fetch (default: 7)curl -X GET https://api.meshinfer.ai/api/v1/metrics?period=daily&days=7 \ -H "Authorization: Bearer pk_live_xxx"
Response
{
"success": true,
"summary": {
"total_requests": 150000,
"avg_latency_ms": "245.50",
"avg_success_rate": "99.80",
"period_days": 7,
"metrics_count": 7
},
"metrics": [
{
"user_email": "user@example.com",
"period": "daily",
"request_count": 21428,
"avg_latency_ms": 245,
"success_rate": 99.8,
"total_savings": 125.50,
"timestamp": "2026-04-21T23:59:00Z"
}
],
"timestamp": "2026-04-21T15:30:00Z"
}GET /api/v1/alerts
List active and resolved alerts.
Query Parameters
daysLookback period (default: 30)statustriggered | acknowledged | resolvedcurl -X GET https://api.meshinfer.ai/api/v1/alerts?status=triggered \ -H "Authorization: Bearer pk_live_xxx"
POST /api/v1/alerts
Create a new alert.
curl -X POST https://api.meshinfer.ai/api/v1/alerts \
-H "Authorization: Bearer pk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"rule_name": "High Latency Alert",
"metric": "latency_ms",
"severity": "warning",
"threshold": 500,
"message": "Average latency exceeded 500ms"
}'GET /api/v1/maintenance
List scheduled maintenance windows.
curl -X GET https://api.meshinfer.ai/api/v1/maintenance?days=30 \ -H "Authorization: Bearer pk_live_xxx"
POST /api/v1/maintenance
Schedule a maintenance window.
curl -X POST https://api.meshinfer.ai/api/v1/maintenance \
-H "Authorization: Bearer pk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"title": "Database Upgrade",
"description": "Upgrading primary database cluster",
"scheduled_start": "2026-04-25T02:00:00Z",
"estimated_duration_minutes": 120
}'DELETE /api/v1/maintenance/:window_id
Cancel a scheduled maintenance window.
curl -X DELETE https://api.meshinfer.ai/api/v1/maintenance/maint_123abc \ -H "Authorization: Bearer pk_live_xxx"
Rate Limits
Developer Tier
100 requests/minuteStartup Tier
1,000 requests/minuteGrowth Tier
10,000 requests/minuteEnterprise Tier
UnlimitedStatus Codes
200Success
201Created
400Bad Request
401Unauthorized
429Rate Limited
500Server Error
Need help? Email support@meshinfer.ai
