Use Auriko as your LLM provider in LangChain with a drop-inDocumentation Index
Fetch the complete documentation index at: https://docs.auriko.ai/llms.txt
Use this file to discover all available pages before exploring further.
ChatOpenAI replacement.
This integration is Python-only. For TypeScript, use the Vercel AI SDK integration or configure the OpenAI SDK directly with Auriko’s base URL.
Prerequisites
Installation
Use SDK adapter
Use theAurikoChatOpenAI adapter:
AurikoChatOpenAI extends LangChain’s ChatOpenAI with:
use_responses_api=Falseset by default (ensures routing metadata and typed error mapping)- Routing injection via
extra_body - OpenAI error mapping to typed Auriko error classes
Configure options
AurikoChatOpenAI accepts these parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
model | str | (required, via parent) | Model ID |
api_key | str | None | AURIKO_API_KEY env | API key |
routing | RoutingOptions | None | None | Routing configuration |
base_url | str | "https://api.auriko.ai/v1" | API base URL |
**kwargs | Passed through to ChatOpenAI (e.g., temperature, max_tokens) |
Configure routing
You can pass aRoutingOptions instance to control cost, latency, and quality trade-offs:
generation_info when using generate():
Configure manually
Alternative: configure LangChain manually
Alternative: configure LangChain manually
If you prefer to use
ChatOpenAI directly:use_responses_api=False is the default. Chat Completions streaming includes routing_metadata in the response. /v1/responses streaming does not include routing_metadata yet.Alternative: use AurikoAsyncOpenAI (experimental)
If you can’t use auriko[langchain] (for example, your project pins a different langchain-openai version), pass AurikoAsyncOpenAI into LangChain’s async_client parameter:
client.chat.completions (not the whole client) and provide any string as api_key (LangChain requires it for construction). Read client.last_routing_metadata after each call. See AurikoAsyncOpenAI for the full class reference.
Notes
- OpenAI API errors map to typed Auriko error classes (
RateLimitError,PermissionDeniedError,BadRequestError, etc.). AurikoChatOpenAIsetsuse_responses_api=Falseby default.