Meridian Blue Documentation
An OpenAI-compatible LLM gateway. Drop in by changing two lines: base_url and api_key. Meridian Blue routes your request across providers, falls back on failure, and gives you a single audited surface for the AI traffic you ship to production.
Overview
Meridian Blue is a multi-provider LLM gateway. You write your application against the OpenAI SDK you already use; Meridian Blue handles routing, fallback, billing, and per-key spend caps without any changes to your inference code.
The API lives at https://api.meridianblue.ai/v1. The dashboard for keys, billing, and usage is at https://app.meridianblue.ai.
What you get
- OpenAI-compatible chat completions. Same request and response shape; existing SDKs work unchanged.
- Ordered fallback chains. Send
models: ["primary", "fallback1", "fallback2"]and Meridian Blue walks the list in order, stopping at the first success. - Smart retries. Retryable upstream failures (429, 5xx, network) are retried with exponential backoff before the failure ever reaches your client.
- Native SDK passthroughs. Anthropic, Groq, Cohere, and Google Gemini native endpoints are mounted at their original paths so SDKs from those vendors also work by changing only the base URL.
- Per-key spend caps. Every key carries a credit limit. The key returns
402 Payment Requiredwhen exhausted, and webhooks fire at 50% / 80% / 100% of the cap. - Routing transparency. Every response carries
X-Meridian-*headers showing which provider served it, latency, and whether a fallback was used.
Choose your path
| If you are… | Start here |
|---|---|
| A developer integrating Meridian Blue for the first time | Quickstart › Chat completions |
| Wiring up resilience across providers | Fallback chains › Smart retries › Load balancing |
| Automating spend & usage alerts | Per-key spend caps › Webhooks |
| Bringing your own provider keys | BYOK |
SDKs
Meridian Blue is OpenAI-compatible, so the official OpenAI SDKs work unchanged: JavaScript, Python, Go, Ruby, PHP, .NET, raw HTTP. Just point base_url at https://api.meridianblue.ai/v1.
For native SDKs from other vendors, Meridian Blue exposes their original endpoint paths so you can keep using their client:
- Anthropic SDK —
POST /v1/messages - Groq SDK —
POST /openai/v1/chat/completions - Cohere SDK —
POST /v1/chat(v1) orPOST /v2/chat(v2) - Google Gemini SDK —
POST /v1beta/models/{model}:generateContent
Status & support
- Health —
GET https://api.meridianblue.ai/healthreturns server & database liveness. - Metrics —
GET https://api.meridianblue.ai/metricsexposes a Prometheus scrape target. - Email —
[email protected]for everything else.