Integrations/Node.js SDK
🟢

Node.js SDK

SDK

The official openai npm package works out of the box. Set baseURL to the Qubax endpoint and pass your API key — every chat completion, streaming, and function-calling feature is supported.

Official docs

Install

Shell
npm install openai

Quickstart

JavaScript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.qubax.ai/v1",
  apiKey: process.env.QUBAX_API_KEY,
});

const response = await client.chat.completions.create({
  model: "gpt-5",
  messages: [
    { role: "system", content: "You are a helpful assistant." },
    { role: "user", content: "Explain quantum entanglement in one sentence." },
  ],
});

console.log(response.choices[0].message.content);

Setup steps

  1. 1

    Install the SDK

    Run npm install openai in your project directory. Node.js 18+ is required.

  2. 2

    Configure the client

    Import OpenAI and create a new instance with baseURL set to https://api.qubax.ai/v1 and apiKey set to your Qubax key.

  3. 3

    Make a request

    Call client.chat.completions.create() with a model and messages array. Streaming, embeddings, and tool calls all work the same as OpenAI.

ℹ️
Store your key in an environment variable (e.g. QUBAX_API_KEY) rather than hardcoding it.

Test your connection

Paste your Qubax API key and send a live request to verify everything is wired up. Don't have a key yet?

Create one in the dashboard