Monitoring and Evaluating the Availability of API Relay Services
Availability is a useful but incomplete metric for multi-model API relay services. This article explains how to combine 7-day and 30-day availability, coverage data, threshold margins, and standardized capability tests to distinguish short-term recovery, borderline stability, and persistent failure—and turn those findings into practical routing decisions.
1. The Starting Point: Higher Availability Does Not Always Mean a Better Decision
For aggregated services that relay requests across multiple model APIs, availability is usually the metric operators watch most closely. It is intuitive, easy to collect, and convenient for comparison. However, it can also lead to misleading decisions.
Three patterns commonly appear in the observed data:
- One group reports 96.9% availability over 7 days but only 56.9% over 30 days—a 40-percentage-point gap between the two windows.
- Another group rises slightly from 95.0% to 95.1% over 30 days, while reaching 96.7% over 7 days. Its long-term result remains close to the threshold.
- Several other groups remain just above 92% over 7 days and have not returned to the 95% decision threshold.
These figures represent three different states: short-term recovery with poor historical performance, long-term borderline stability, and continued failure to meet the threshold.
Looking at only one time window can lead to incorrect conclusions. The first group may be mistaken for a high-quality option, while the second may be treated as fully safe. The central principle of this article is therefore:
Availability must be evaluated across both time windows and interpreted together with measured pass rates.
2. Align the Measurement Methodology Before Comparing Numbers
Availability is highly dependent on how it is measured. An aggregated dashboard should explicitly state at least four aspects of its methodology:
- Data source: Monitoring data publicly provided by each site, rather than measurements from a unified external probe.
- Refresh interval: A fixed refresh cycle after aggregation, such as once every 30 minutes. The refresh granularity determines whether short-lived spikes are visible or smoothed out.
Window definition: The 7-day window represents short-term performance and the 30-day window represents long-term performance. Both are calculated as:
successful requests / total requestsMissing-data handling: Sites without monitoring data are excluded from availability aggregation and must be labeled separately. They should not be counted as either 0% or 100%.
The fourth point is particularly easy to overlook. Silently including sites without monitoring data in the denominator will systematically reduce the overall availability rate. Counting them as fully available creates a false sense of safety. The correct approach is to display them separately and make coverage a visible metric in its own right.
3. The Two-Window Gap: The Most Informative Derived Metric
Availability by itself is a single value. Subtracting the two time windows provides a sense of direction:
gap = rate(7d) - rate(30d)
- A significantly positive gap indicates recent recovery after poor historical performance. The 30-day value reflects the past, while the 7-day value reflects current conditions. The appropriate conclusion is “short-term performance meets the threshold, but long-term stability is not yet verified.” Continue observing the group for several weeks before making a final classification.
- A gap close to zero with both windows above the threshold indicates genuine stability and makes the group a suitable default candidate.
- A gap close to zero with both windows below the threshold indicates a persistent failure. The group should be downgraded or removed from service.
- A negative gap indicates recent deterioration and should receive the highest troubleshooting priority.
A sample implementation is shown below:
LINE = 95.0 # Decision thresholdMARGIN_WARN = 0.5 # Warning margindef evaluate(r7, r30):gap = r7 - r30if r7 < LINE and r30 < LINE:return "Consistently below threshold", "Downgrade/remove"if gap > 5.0:return "Short-term recovery pending verification", "Observe for 2-3 weeks"if min(r7, r30) < LINE:return "Borderline and not back above threshold", "Limit traffic share"if min(r7, r30) - LINE < MARGIN_WARN:return "Operating close to the threshold", "Set a margin alert"return "Stable", "Suitable as a default candidate"
4. Margin Management: Borderline Performance Needs a Separate Alert
A change such as “30-day availability increased from 95.0% to 95.1%” is only 0.1 percentage point in absolute terms, but its operational meaning is significant. The group has remained close to the threshold for a long time, and a single upstream fluctuation could push it below the line.
In practice, systems should define an additional margin line, such as 0.5 percentage points above the threshold. When either time window falls between the threshold and the margin line, the system should trigger a warning instead of waiting for availability to fall below the threshold.
The value of margin alerts is that they turn post-incident confirmation into preventive intervention.
5. Availability Does Not Equal Capability: Add Measured Test Results
Availability answers whether an API can usually be reached. It does not show whether the response is correct or whether the service can satisfy the required task.
In the original aggregated results, more than 1,300 groups underwent standardized testing, while slightly more than 700 were classified as passing—just over half. This indicates that many groups have high availability but still fail capability tests.
If the routing layer ranks groups only by availability, a considerable share of traffic may be directed to services that are reachable but not actually suitable for the task.
A two-dimensional decision matrix is therefore recommended:
| Measured test passes | Measured test fails | |
|---|---|---|
| Both windows meet the threshold with sufficient margin | Default candidate | Rate-limit; use only as a fallback |
| Borderline or recently recovered | Roll out with a small traffic share | Exclude |
| Not back above the threshold or consistently below it | Continue observing | Exclude |
6. Implementation Checklist
- Preserve the original successful and failed request counts in the collection layer. Do not store only percentages, or historical windows cannot be recalculated.
- Record coverage and the list of sites with missing data explicitly in the aggregation layer.
- Have the decision layer output a three-part result—status, margin, and recommended action—rather than a single score.
- Display the 7-day and 30-day values side by side and highlight the
gap. - Preserve historical snapshots for structural changes such as replacing an entire group, so that changes can be analyzed afterward.
7. Conclusion
Overall availability may change very little from week to week, while three specific risk patterns require separate attention: short-term performance that meets the threshold but lacks long-term validation, long-term performance that remains close to the threshold without sufficient margin, and performance that stays below the decision line.
Combining the two-window gap with measured pass rates in a single decision framework helps prevent the mistake of assuming that “better numbers” always mean “better conclusions.”
Availability filters out services that cannot reliably connect. Measured testing filters out services that connect but cannot perform the required task. Both are necessary.
