-
Notifications
You must be signed in to change notification settings - Fork 0
Overview
Nick edited this page Nov 13, 2025
·
2 revisions
ReliAPI is a small reliability layer for ANY HTTP API and ANY LLM API. It provides retries, circuit breaker, cache, idempotency, and predictable cost controls in a single, self-hostable gateway.
ReliAPI works for any HTTP-based API — payment services, SaaS APIs, internal microservices, and LLM providers. It applies the same retry, circuit breaker, cache, idempotency, and error handling policies uniformly across all API types.
Use ReliAPI when you need:
- Retries: Automatic retries with exponential backoff for transient failures
- Circuit Breaker: Per-target failure detection and automatic cooldown
- Fallback Chains: Automatic failover to backup targets when primary fails
- Unified Errors: Normalized error format (no raw stacktraces)
- Budget Caps: Hard cap (reject) and soft cap (throttle) for LLM costs
- Cost Estimation: Pre-call cost estimation with policy application
- Caching: TTL cache for GET/HEAD and LLM requests
- Idempotency: Request coalescing for concurrent identical requests
- Low Overhead: Minimal latency addition (< 10ms typical)
- Prometheus Metrics: Request counts, latency, errors, cache hits, costs
- Structured Logging: JSON logs with request IDs
-
Health Endpoints:
/healthzfor monitoring
You probably don't need ReliAPI if:
- Simple direct calls: You're making simple HTTP calls without retry/cache needs
- No SLA requirements: You don't need guaranteed retries or circuit breaker behavior
- No budget concerns: LLM costs are not a concern and you don't need cost caps
- Single provider: You're only using one LLM provider and don't need abstraction
- No idempotency needs: You don't need request coalescing or duplicate prevention
ReliAPI is typically deployed:
- LLM Providers: OpenAI, Anthropic, Mistral
- Payment Services: Stripe, PayPal, payment gateways
- SaaS APIs: External REST APIs with rate limits
- Service Mesh: Reliability layer for internal HTTP services
- API Gateway: Single point for retry, cache, and error handling
- Container Sidecar: Deployed alongside application containers
- Kubernetes: As a sidecar container in pods
Client → ReliAPI → Target (HTTP/LLM)
↓
[Retry] → [Circuit Breaker] → [Cache] → [Idempotency] → [Upstream]
↓
[Normalize] → [Response Envelope]
ReliAPI sits between your application and upstream APIs, applying reliability layers uniformly.
A target is an upstream API endpoint configured in config.yaml. Each target has:
-
base_url: Upstream API base URL -
timeout_ms: Request timeout -
circuit: Circuit breaker configuration -
cache: Cache configuration -
auth: Authentication configuration -
llm: LLM-specific configuration (if applicable)
- Retries: Automatic retries with exponential backoff
- Circuit Breaker: Per-target failure detection
- Cache: TTL cache for GET/HEAD and LLM requests
- Idempotency: Request coalescing for duplicate requests
- Budget Caps: Cost control for LLM requests
All responses follow a unified format:
{
"success": true,
"data": {...},
"meta": {
"target": "openai",
"cache_hit": false,
"idempotent_hit": false,
"retries": 0,
"duration_ms": 150,
"cost_usd": 0.001
}
}- Architecture — Detailed architecture overview
- Configuration — Configuration guide
- Reliability Features — Detailed feature explanations
- Comparison — Comparison with other tools