oxDocs
Browse documentation
Introduction
Vision API
Inference API
Realtime
Integrations
LiveKit & SIP
Administration
Reference

Get started

Install and initialize the SDK

Install @ox/sdk, create a server client, and keep permanent credentials out of browser code.

Before you begin

You need Node.js 20 or newer, an Ox API key, and the private-preview package artifact supplied with your access. Keep the API key in trusted server code. Never place it in browser JavaScript, mobile binaries, source control, URLs, or logs. The current public preview API origin is https://www.amerint.co; set it explicitly until the permanent Ox domain is assigned.

Install the private preview

The package is not published to npm yet. Install the supplied artifact directly:

bash

npm install /absolute/path/to/ox-sdk-0.1.0.tgz

Create a server client

Create one client and reuse it. The example reads OX_API_KEY from the process environment and fails before making a request when the variable is missing.

JavaScript

import { Ox } from "@ox/sdk";

const apiKey = process.env.OX_API_KEY;
if (!apiKey) throw new Error("OX_API_KEY is required");

const ox = new Ox({
  apiKey,
  baseUrl: process.env.OX_API_BASE_URL ?? "https://www.amerint.co",
});

const models = await ox.models.list();
if (models.data.length === 0) {
  throw new Error("No Ox models are enabled for this project");
}

console.log("Connected to Ox");
console.table(models.data.map(({ id }) => ({ id })));

Save this as quickstart.mjs. Load the key from your secret manager or a protected local environment file, then run:

bash

node --env-file=.env quickstart.mjs

Or download the Node quickstart and run the same command after installing your private-preview SDK artifact.

Verify the connection

A successful run prints Connected to Ox followed by the model IDs enabled for your project. A 401 means the server credential is missing or invalid. An empty model list means the project needs model access before it can run inference.

The SDK rejects permanent credentials in browser runtimes, uses a ten-minute request timeout, supports per-request cancellation and timeouts, and does not retry inference or session creation automatically.

Help improve this guideFound something unclear or incomplete?
Report an issue ↗View source ↗