> ## Documentation Index > Fetch the complete documentation index at: https://openrouter.ai/docs/llms.txt > Use this file to discover all available pages before exploring further. # Uptime Optimization > OpenRouter tracks provider availability export const UptimeChart = ({permaslug}) => { const [uptime, setUptime] = useState(null); const [didError, setDidError] = useState(false); const getAvailabilityFillClass = availability => { if (availability === null) return "fill-current text-gray-500"; if (availability >= 95) return "fill-current text-green-500"; if (availability >= 85) return "fill-current text-yellow-600"; return "fill-current text-red-500"; }; const formatPercent = value => { if (typeof value !== "number") return "N/A"; const normalizedValue = Number((value * 100).toPrecision(12)); return `${(Math.floor(normalizedValue) / 100).toFixed(2)}%`; }; const formatTimestamp = timestamp => { if (!timestamp) return "No data"; return new Date(`${timestamp.replace(" ", "T")}Z`).toLocaleString(); }; const getRecentDomain = (points, fields) => { const values = fields.flatMap(field => points.map(point => point[field]).filter(value => typeof value === "number" && Number.isFinite(value))); if (values.length === 0) return { min: 0, max: 100 }; const minimum = Math.min(...values); const maximum = Math.max(...values); const padding = Math.max((maximum - minimum) * 0.1, 0.5); const min = Math.max(0, Math.floor(minimum - padding)); const max = Math.min(100, Math.ceil(maximum + padding)); if (min < max) return { min, max }; if (min === 0) return { min: 0, max: 1 }; return { min: min - 1, max }; }; const getLineSegments = (points, field, domainMin, domainMax, plotLeft, plotWidth) => { const segments = []; let segment = []; const denominator = Math.max(points.length - 1, 1); const domainRange = Math.max(domainMax - domainMin, 1); points.forEach((point, index) => { if (typeof point[field] !== "number") { if (segment.length > 0) segments.push(segment); segment = []; return; } const x = plotLeft + index / denominator * plotWidth; const normalized = (point[field] - domainMin) / domainRange; const y = Math.min(132, Math.max(12, 132 - normalized * 120)); segment.push({ x, y }); }); if (segment.length > 0) segments.push(segment); return segments; }; const renderLineSegments = (segments, strokeClass, markerClass) => segments.flatMap((segment, segmentIndex) => { const elements = []; if (segment.length > 1) { elements.push( `${x},${y}`).join(" ")} className={`fill-none ${strokeClass}`} stroke="currentColor" strokeWidth="2" />); } if (segment.length === 1) { const [{x, y}] = segment; elements.push(); } return elements; }); useEffect(() => { const controller = new AbortController(); const url = `https://openrouter.ai/api/frontend/v1/stats/model-uptime-recent?permaslug=${encodeURIComponent(permaslug)}`; fetch(url, { signal: controller.signal }).then(res => res.ok ? res.json() : Promise.reject(new Error(`HTTP ${res.status}`))).then(body => { if (body.data === null || body.data === undefined) { throw new Error("Missing uptime data"); } setUptime(body.data); }).catch(err => { if (err.name !== "AbortError") setDidError(true); }); return () => controller.abort(); }, [permaslug]); if (didError) { return

Uptime data could not be retrieved at this time.

; } if (uptime === null) { return
; } const hourly = Array.isArray(uptime.hourly) ? uptime.hourly : []; const buckets = Array.isArray(uptime.buckets) ? uptime.buckets : []; const hasAvailabilityData = typeof uptime.availability === "number" || hourly.some(point => typeof point.availability === "number") || buckets.some(bucket => typeof bucket.availability === "number"); if (!hasAvailabilityData) { return

Not enough uptime data to display yet.

; } const chartId = permaslug.replace(/[^a-zA-Z0-9_-]/g, "-"); const hasAvailabilityWithoutRouting = buckets.some(bucket => typeof bucket.availabilityWithoutRouting === "number"); const hourlyBarWidth = hourly.length === 0 ? 0 : 100 / hourly.length; const recentPlotLeft = 80; const recentPlotWidth = 720; const recentViewBoxWidth = recentPlotLeft + recentPlotWidth; const recentDomain = getRecentDomain(buckets, ["availability", "availabilityWithoutRouting"]); const recentSegments = getLineSegments(buckets, "availability", recentDomain.min, recentDomain.max, recentPlotLeft, recentPlotWidth); const withoutRoutingSegments = hasAvailabilityWithoutRouting ? getLineSegments(buckets, "availabilityWithoutRouting", recentDomain.min, recentDomain.max, recentPlotLeft, recentPlotWidth) : []; return

Availability over the last 3 days

{typeof uptime.availability === "number" ?

Availability {formatPercent(uptime.availability)}

: null}

Hourly availability

Hourly availability over the last 3 days {hourly.map((point, index) => )}
{formatTimestamp(hourly[0]?.timestamp)} {formatTimestamp(hourly.at(-1)?.timestamp)}

Availability over the last 24 hours

Availability over the last 24 hours, including availability without routing when available {formatPercent(recentDomain.max)} {formatPercent((recentDomain.min + recentDomain.max) / 2)} {formatPercent(recentDomain.min)} {renderLineSegments(recentSegments, "text-green-500", "fill-current text-green-500")} {renderLineSegments(withoutRoutingSegments, "text-yellow-600", "fill-current text-yellow-600")}
{formatTimestamp(buckets[0]?.timestamp)} {formatTimestamp(buckets.at(-1)?.timestamp)}
{hasAvailabilityWithoutRouting && }

Three-day aggregate: availability {formatPercent(uptime.availability)}, uptime{" "} {formatPercent(uptime.uptime)}.

Hourly availability values:

    {hourly.map(point =>
  • {point.timestamp}: {formatPercent(point.availability)}
  • )}

Recent availability values:

    {buckets.map(bucket =>
  • {bucket.timestamp}: availability {formatPercent(bucket.availability)} {hasAvailabilityWithoutRouting && `, without routing ${formatPercent(bucket.availabilityWithoutRouting)}`}
  • )}

When an error occurs in an upstream provider, we can recover by routing to another healthy provider, if your request filters allow it. You can access per-provider uptime data programmatically through the{" "} Endpoints API .{" "} Learn more about our load balancing and customization options.

; }; OpenRouter continuously monitors the health and availability of AI providers to ensure maximum uptime for your applications. We track response times, error rates, and availability across all providers in real-time, and route based on this feedback. ## How It Works OpenRouter tracks response times, error rates, and availability across all providers in real-time. This data helps us make intelligent routing decisions and provides transparency about service reliability. ## Uptime Example: Claude Sonnet 4.6 ## Uptime Example: GLM 5.1 ## Customizing Provider Selection While our smart routing helps maintain high availability, you can also customize provider selection using request parameters. This gives you control over which providers handle your requests while still benefiting from automatic fallback when needed. Learn more about customizing provider selection in our [Provider Routing documentation](/docs/guides/routing/provider-selection).