Documentation
TypeScript quickstart
Integrate Meridian into your TypeScript application in under five minutes. ESM-first, fully typed, with streaming and tool-calling support.
Install
npm i openaiMeridian is compatible with the OpenAI Node.js SDK. Point the baseURL at our endpoint and use your API key.
Basic ESM example
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.getnimbus.net/v1",
apiKey: process.env.MERIDIAN_API_KEY!,
});
const completion = await client.chat.completions.create({
model: "meridian-1",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "Explain ECC memory in two sentences." },
],
});
console.log(completion.choices[0].message.content);Streaming
const stream = await client.chat.completions.create({
model: "meridian-1",
messages: [{ role: "user", content: "Write a haiku about Rust." }],
stream: true,
});
for await (const chunk of stream) {
const delta = chunk.choices[0]?.delta?.content;
if (delta) process.stdout.write(delta);
}Tool calling
const tools = [
{
type: "function" as const,
function: {
name: "get_weather",
description: "Get current temperature for a city",
parameters: {
type: "object",
properties: {
city: { type: "string" },
},
required: ["city"],
},
},
},
];
const response = await client.chat.completions.create({
model: "meridian-1",
messages: [{ role: "user", content: "What's the weather in Oslo?" }],
tools,
tool_choice: "auto",
});
const toolCall = response.choices[0]?.message?.tool_calls?.[0];
if (toolCall) {
const args = JSON.parse(toolCall.function.arguments);
console.log("Tool called:", toolCall.function.name, args);
}Next steps
- → Full API reference — every endpoint, parameter, and response shape.
- → Rate limits & billing — understand your quota and how to scale.
- → Advanced streaming patterns — abort signals, retry logic, edge runtime.