OpenAI and Anthropic SDK compatibility
Meridian implements the OpenAI Chat Completions API and the Anthropic Messages API exactly. Drop in your existing SDK with a new base URL and key. No client rewrites.
OpenAI Python SDK
Install openai and set the base URL to Meridian. Your code stays the same.
from openai import OpenAI
client = OpenAI(
api_key="nim_live_...",
base_url="https://meridian.getnimbus.net/api/v1",
)
resp = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
OpenAI TypeScript SDK
Use the official client with the Meridian endpoint. Models and payload format are compatible with Chat Completions.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "nim_live_...",
baseURL: "https://meridian.getnimbus.net/api/v1",
});
const response = await client.chat.completions.create({
model: "auto",
messages: [{ role: "user", content: "Hello" }],
});
console.log(response.choices[0].message?.content);
Anthropic Python SDK
Point the Anthropic client at Meridian and keep your message payloads unchanged.
from anthropic import Anthropic
client = Anthropic(
api_key="nim_live_...",
base_url="https://meridian.getnimbus.net/api/v1",
)
response = client.messages.create(
model="claude-3-5-sonnet-20241022",
max_tokens=128,
messages=[{"role": "user", "content": "Hello"}],
)
print(response.content[0].text)
Anthropic TypeScript SDK
Swap the base URL and key. Meridian forwards the Messages API while keeping the payload schema intact.
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: "nim_live_...",
baseURL: "https://meridian.getnimbus.net/api/v1",
});
const result = await client.messages.create({
model: "claude-3-5-sonnet-20241022",
max_tokens: 128,
messages: [{ role: "user", content: "Hello" }],
});
console.log(result.content[0].text);
Vercel AI SDK
Use the OpenAI adapter with the Meridian base URL. The adapter handles the transport so you keep the same streaming and tool abstractions.
import { createOpenAI } from "@ai-sdk/openai";
const meridian = createOpenAI({
apiKey: process.env.MERIDIAN_API_KEY,
baseURL: "https://meridian.getnimbus.net/api/v1",
});
const result = await meridian.chat("auto").doGenerate({
prompt: [{ role: "user", content: [{ type: "text", text: "Hello" }] }],
});
Drop-in environment variable trick
If you cannot change SDK initialization code, override the base URL and key at the environment level. Most SDKs read these variables on startup.
export OPENAI_API_KEY="nim_live_..."
export OPENAI_BASE_URL="https://meridian.getnimbus.net/api/v1"
export ANTHROPIC_API_KEY="nim_live_..."
export ANTHROPIC_BASE_URL="https://meridian.getnimbus.net/api/v1"