Use Augure with the OpenAI Python SDK
Point the official openai Python package at Augure's Canadian, OpenAI-compatible API: change base_url 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 Python package: the same chat.completions calls, with inference on Canadian infrastructure.
Prerequisites
- Python 3.8+ and
pip install openai. - An Augure API key (
aug_sk_live_…) from the developer dashboard. Plans and pricing: augureai.ca/developers. - The key exported as
AUGURE_API_KEY.
Configure
Two constructor arguments change. Everything else is unchanged.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AUGURE_API_KEY"],
base_url="https://api.augureai.ca/v1",
)
response = client.chat.completions.create(
model="tofino-3",
messages=[{"role": "user", "content": "Say hello in one short sentence."}],
max_tokens=64,
)
print(response.choices[0].message.content)
If you prefer environment variables, the SDK reads OPENAI_BASE_URL and OPENAI_API_KEY, so OpenAI() with no arguments 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:
stream = client.chat.completions.create(
model="rosedale-1",
messages=[{"role": "user", "content": "Hello"}],
stream=True,
stream_options={"include_usage": True},
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
Tools (tools=[...]), response_format, image_url content parts and file content parts for PDFs all 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. When a model thinks, the reasoning comes back in reasoning_content on the message (message.model_extra.get("reasoning_content")). Full list: /docs/models.
Verify it works
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["AUGURE_API_KEY"], base_url="https://api.augureai.ca/v1")
response = client.chat.completions.create(
model="tofino-3",
messages=[{"role": "user", "content": "Reply with the single word OK."}],
max_tokens=64,
)
print(response.choices[0].message.content)
print(response.model_extra.get("_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
- The SDK keeps unknown response fields; read them through
model_extraas above rather than by attribute if you use a type checker. - OpenAI model aliases are accepted if you cannot change the model name yet:
gpt-4andgpt-4omap toossington-4,gpt-4o-miniandgpt-3.5-turbomap totofino-3. client.models.list()returns the ids your key can use.- Errors use the OpenAI error shape (
error.code, for exampleinvalid_api_keyorcontext_length_exceeded), so the SDK's exception classes work unchanged.