Use Augure with LangChain (Python)
Run LangChain chains and agents on Augure's Canadian, OpenAI-compatible API with ChatOpenAI and a custom base_url.
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 chat model behind LangChain's ChatOpenAI class, so chains, agents, tool binding and streaming run with inference on Canadian infrastructure.
Prerequisites
- Python 3.9+ and
pip install langchain-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
Use ChatOpenAI from langchain_openai with base_url set to Augure. Set use_responses_api=False so LangChain always sends Chat Completions requests; Augure does not expose a Responses endpoint.
import os
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="tofino-3",
api_key=os.environ["AUGURE_API_KEY"],
base_url="https://api.augureai.ca/v1",
max_tokens=64,
use_responses_api=False,
)
response = llm.invoke("Say hello in one short sentence.")
print(response.content)
ChatOpenAI also reads OPENAI_API_KEY and OPENAI_BASE_URL from the environment if you leave the arguments out.
Streaming, with usage reported in the last chunk (LangChain sets stream_options.include_usage when stream_usage=True):
llm = ChatOpenAI(model="rosedale-1", base_url="https://api.augureai.ca/v1",
api_key=os.environ["AUGURE_API_KEY"], stream_usage=True)
for chunk in llm.stream("Hello"):
print(chunk.content, end="", flush=True)
Tool calling uses the standard bind_tools path, and structured output works with with_structured_output(Schema, method="function_calling"), since both go through the tools field of the request:
llm_with_tools = llm.bind_tools([search_grant_programs])
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. ChatOpenAI has a reasoning_effort argument; on older langchain-openai releases pass extra_body={"reasoning_effort": "none"} instead. Full list: /docs/models.
Verify it works
LangChain's response_metadata keeps token usage and the model name but not Augure's extra top-level fields, so check residency with one direct call:
curl -s https://api.augureai.ca/v1/chat/completions \
-H "Authorization: Bearer $AUGURE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"tofino-3","max_tokens":64,"messages":[{"role":"user","content":"Reply with the single word OK."}]}'
The JSON ends with an _augure block, for example "_augure": {"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
message.contentholds the final answer only. When a reasoning model thinks, the reasoning text is returned by the API inreasoning_contentand is not merged intocontent.- For LangGraph agents, pass the same
ChatOpenAIinstance; nothing else changes. - OpenAI model aliases are accepted:
gpt-4omaps toossington-4,gpt-4o-minitotofino-3. - Use
ChatOpenAI, notOpenAI(the legacy completions class); Augure serves/v1/chat/completions.