Skip to content

MRP API Reference ​

Platform Admin API endpoints for the Model Routing Protocol. All endpoints require the require_platform_admin_with_api_key dependency (admin API key or platform admin session).

Base Path

All endpoints below are relative to /api/platform-admin/routing.

Overview & Status ​

GET /mrp/overview ​

Returns MRP status, route counts, and provider summary.

GET /mrp/routes ​

Returns all MRIB routes. Query params: modality, provider.

GET /mrp/health-matrix ​

Per-provider health matrix with circuit breaker states.

Simulation & Testing ​

POST /mrp/simulate ​

Dry-run route resolution for a single model.

Request Body:

json
{
  "model_id": "anthropic/claude-sonnet-4.6",
  "modality": "chat",
  "explicit_route": null,
  "org_id": null,
  "routing_profile": "balanced"
}

Model IDs are automatically canonicalized — vendor prefixes are stripped and aliases applied.

POST /mrp/simulate-all ​

Dry-run route resolution for every unique model in the MRIB.

Request Body:

json
{
  "modality": "chat",
  "routing_profile": null,
  "org_id": null
}

Response:

json
{
  "results": [
    {
      "model_id": "gpt-4.1",
      "canonical_id": "gpt-4.1",
      "best_route": { "provider": "openai", "model_id": "gpt-4.1", ... },
      "fallback_used": false,
      "candidates_evaluated": 1,
      "resolution_us": 42
    }
  ],
  "total": 45,
  "resolved": 43,
  "failed": 2,
  "elapsed_ms": 12.5
}

POST /mrp/probe-all ​

Send a lightweight "Say OK" prompt (max_tokens=5) to every reachable model. Returns results synchronously after all probes complete.

Query Parameters:

  • concurrency (int, default 5): Maximum concurrent probes (capped at 20).

Response:

json
{
  "results": [
    {
      "model_id": "gpt-4.1",
      "provider": "openai",
      "source_model_id": "gpt-4.1",
      "success": true,
      "latency_ms": 342.1,
      "response_preview": "OK",
      "tokens_used": 3
    }
  ],
  "total": 14,
  "succeeded": 12,
  "failed": 2,
  "elapsed_ms": 4523.0
}

GET /mrp/probe-all/stream ​

SSE stream version of probe-all. Returns results as they complete.

Events:

  • probe_start — {"total": 14, "started_at": "2026-04-12T..."}
  • probe_result — One per model with same shape as sync results
  • probe_done — {"total": 14, "succeeded": 12, "failed": 2, "elapsed_ms": 4523.0}

POST /mrp/audit-context ​

Compare hardcoded context windows and capabilities against live provider data.

Request Body:

json
{
  "include_live": true,
  "include_openrouter": true,
  "severity_filter": null
}

Response includes:

  • Per-model entries with hardcoded_context, live_context, severity (ok/minor/major/missing)
  • Summary with counts per severity, unseeded MRIB routes, capability gaps

POST /mrp/simulate/counterfactual ​

Run simulation against a modified MRIB state (what-if analysis).

Route Management ​

PATCH /mrp/route/:provider/:model_id ​

Update route attributes (local_pref, weight, maintenance).

PATCH /mrp/routes/batch ​

Bulk route attribute updates.

POST /mrp/maintenance/enter ​

Enter maintenance mode for a provider.

POST /mrp/maintenance/exit ​

Exit maintenance mode for a provider.

Events & Monitoring ​

GET /mrp/events ​

Recent MRP events (route changes, failovers, circuit breaks).

GET /mrp/events/stream ​

SSE stream of live MRP events.

GET /mrp/shadow ​

Shadow-mode divergence report.

GET /mrp/circuit-breakers ​

Circuit breaker states for all providers.

GET /mrp/dampening ​

Dampening state for all routes.

GET /mrp/capacity ​

Capacity tracker state.

GET /mrp/budgets ​

Budget engine state.

GET /mrp/audit ​

Configuration change audit log.

Authentication ​

All MRP endpoints require platform admin authentication. Use either:

  • Session cookie from the admin UI
  • Authorization: Bearer <platform-admin-api-key> header

SOC 2 Type II Certified | BAA Available | HIPAA-Ready