← Integrations

Use Augure with the OpenAI Node.js SDK

Point the official openai npm package at Augure's Canadian, OpenAI-compatible API: change baseURL and the key, keep your code.

Updated 2026-10-26 · Configuration shown as documented by the tool; not yet verified end to end by Augure. · Markdown version

You get Augure as the model provider behind the official openai npm package: the same chat.completions calls in JavaScript or TypeScript, with inference on Canadian infrastructure.

Prerequisites

Configure

Two constructor options change. Everything else is unchanged.

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.AUGURE_API_KEY,
  baseURL: "https://api.augureai.ca/v1",
});

const response = await client.chat.completions.create({
  model: "tofino-3",
  messages: [{ role: "user", content: "Say hello in one short sentence." }],
  max_tokens: 64,
});
console.log(response.choices[0].message.content);

The snippet uses top-level await, so run it as an ES module (.mjs, or "type": "module" in package.json).

If you prefer environment variables, the SDK reads OPENAI_BASE_URL and OPENAI_API_KEY, so new OpenAI() with no options also works:

export OPENAI_BASE_URL=https://api.augureai.ca/v1
export OPENAI_API_KEY=aug_sk_live_...

Streaming, with usage in the final chunk:

const stream = await client.chat.completions.create({
  model: "rosedale-1",
  messages: [{ role: "user", content: "Hello" }],
  stream: true,
  stream_options: { include_usage: true },
});
for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

The last chunk carries usage and an empty choices array, so keep the optional chaining. Tools (tools: [...]), response_format, image_url content parts and file content parts for PDFs use the standard OpenAI request shape. See the API reference.

Pick a model

Model When to use
ossington-5 Flagship reasoning. 256K context, 32,768 max output. Default for hard tasks.
rosedale-1 Premium reasoning, up to 1M context on paid plans, Canadian inference. Long documents, agent loops.
tofino-3 Fast everyday model, 256K context, 16,384 max output, no thinking. Chat, extraction, classification.

model: "auto" lets the gateway pick. On ossington-5, reasoning_effort: "none" turns thinking off and is the fastest setting for mechanical tasks; low, medium and high are accepted on reasoning models; tofino-3 ignores it. Reasoning comes back in reasoning_content on the message. Full list: /docs/models.

Verify it works

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.AUGURE_API_KEY,
  baseURL: "https://api.augureai.ca/v1",
});
const response = await client.chat.completions.create({
  model: "tofino-3",
  messages: [{ role: "user", content: "Reply with the single word OK." }],
  max_tokens: 64,
});
console.log(response.choices[0].message.content);
console.log(response._augure);

The second line prints the _augure block that every response carries, for example { gateway_region: 'ca-montreal-1', inference_region: 'ca-on-toronto', request_id: '...' }. inference_region tells you where the model ran. Inference is on Canadian infrastructure first, with disclosed failover to vetted EU partners under zero data retention, never the US.

Notes

  • _augure and reasoning_content are not in the SDK's TypeScript types. In TypeScript, read them with a cast, for example (response as { _augure?: unknown })._augure.
  • OpenAI model aliases are accepted if you cannot change the model name yet: gpt-4 and gpt-4o map to ossington-4, gpt-4o-mini and gpt-3.5-turbo map to tofino-3.
  • await client.models.list() returns the ids your key can use.
  • Errors use the OpenAI error shape, so OpenAI.APIError and its subclasses work unchanged.

See also