API Reference
REST API and Python SDK for programmatic fleet management. Base URL: https://api.mlsrvyn.com/v1. All requests require Authorization: Bearer <api-key>.
Models
/models
List all registered model endpoints in the workspace.
/models/{model_id}
Get current status, archetype, SLO compliance, and replica count for a single model.
/models/{model_id}/policy
Update scaling policy for a model. Accepts partial updates — only fields included in the request body are changed.
Metrics
/models/{model_id}/metrics
Time-series latency histogram and utilization data. Query params: start, end (Unix timestamps), resolution (1m/5m/1h).
/models/{model_id}/slo-status
Current SLO compliance status with p50/p90/p99 against configured targets.
Scaling Events
/models/{model_id}/events
Scaling event log: scale-up/down triggers with reason, timestamp, and replica delta. Paginated.
/models/{model_id}/scale
Manually trigger a scaling event. Body: {"target_replicas": N, "reason": "string"}. Useful for planned traffic events.
Python SDK example
import mlsrvyn
client = mlsrvyn.Client(api_key="sk-srv-xxxxxxxx")
# Get current SLO status for a model
status = client.models.slo_status("fraud-v7")
print(status.p99_ms, status.within_slo)
# Update scaling bounds before a planned event
client.models.update_policy("rec-v3", scaling={
"min_replicas": 4,
"prewarm_minutes_before_peak": 15
})
# List recent scaling events
events = client.models.events("rec-v3", limit=10)
for e in events:
print(e.timestamp, e.direction, e.delta_replicas)