Quickstart
Make your first request in under five minutes. Meridian Blue is a drop-in replacement for the OpenAI API — any SDK that speaks OpenAI works without modification.
1. Install an OpenAI SDK
You don't need a Meridian Blue-specific SDK. The official OpenAI SDKs work as-is.
npm install openai
# or
pip install openai
2. Get an API key
Sign in to https://app.meridianblue.ai, open the API Keys page, and create a key. Every key starts with the prefix kp_live_. Store it in an environment variable — never commit it to source control.
export MERIDIAN_API_KEY=kp_live_xxxxxxxxxxxxxxxxxxxxxxxx
New accounts start on the free tier with a daily quota of free-tier-eligible model requests. Top up to enable paid models — see the dashboard's Billing page.
3a. Make your first request — JavaScript
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.meridianblue.ai/v1',
apiKey: process.env.MERIDIAN_API_KEY,
});
const response = await client.chat.completions.create({
model: 'gpt-4o',
messages: [
{ role: 'user', content: 'Hello, Meridian!' }
],
});
console.log(response.choices[0].message.content);
3b. Python
from openai import OpenAI
import os
client = OpenAI(
base_url="https://api.meridianblue.ai/v1",
api_key=os.environ["MERIDIAN_API_KEY"],
)
response = client.chat.completions.create(
model="claude-sonnet-4-5-20241022",
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)
3c. cURL
curl https://api.meridianblue.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MERIDIAN_API_KEY" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello"}]
}'
4. Add a fallback chain
Pass models (an ordered array) instead of model. Meridian Blue tries each in order and stops at the first 200. If they all fail, you get a single 502 with the full attempt history.
response = client.chat.completions.create(
model="gpt-4o", # required for SDK type checks; ignored when models[] is set
messages=[...],
extra_body={
"models": [
"gpt-4o",
"claude-sonnet-4-5-20241022",
"llama-3.3-70b-versatile",
],
},
)
See Fallback chains for the full walk semantics and Chat completions for every supported field.
Base URL
| Surface | URL |
|---|---|
| API | https://api.meridianblue.ai/v1 |
| Dashboard | https://app.meridianblue.ai |
| Health probe | https://api.meridianblue.ai/health |
| Prometheus metrics | https://api.meridianblue.ai/metrics |