OpenAI JavaScript SDK from NordRouter
Install the package:
bash
npm install openaits
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.NORDROUTER_API_KEY,
baseURL: "https://nordrouter.com/v1",
});
const response = await client.chat.completions.create({
model: "anthropic/claude-sonnet-4.6",
messages: [{ role: "user", content: "Придумай три названия" }],
});
console.log(response.choices[0].message.content);Do not run this code in a browser: the key will be in the hands of site visitors. The SDK must run on Node.js, Bun, Vercel Function and similar environments.
Official SDK:openai/openai-node.