Skip to main content
Use Auriko as your LLM provider in the OpenAI Agents SDK. This integration is Python-only. For TypeScript, use the Vercel AI SDK integration.
Requires openai-agents >=0.13.

Prerequisites

Install

Use AurikoAsyncOpenAI (experimental)

AurikoAsyncOpenAI (experimental) is an AsyncOpenAI subclass that captures routing metadata from every successful response. Pass it to OpenAIChatCompletionsModel via the openai_client= parameter:
Runner.run_sync() works the same way.

Configure routing

Pass routing options through ModelSettings.extra_body, not through the client.chat.completions.create() call:
The Agents SDK forwards ModelSettings.extra_body to the API call. RoutingOptions.to_extra_body() returns a dict the Auriko API accepts.

Access routing metadata

Read client.last_routing_metadata after a run completes:
The property uses last-write-wins semantics on a shared client. For per-request capture across concurrent runs, pass an on_response callback:
The callback must be synchronous. Passing an async callable raises TypeError.

Handle errors

AurikoAsyncOpenAI raises errors catchable as both Auriko and OpenAI error types:
The same error is also catchable as openai.RateLimitError. Network-layer exceptions (openai.APITimeoutError, openai.APIConnectionError) propagate unchanged.
Mid-stream SSE errors (raised after the HTTP 200 during stream=True) remain unmapped openai.APIError. AurikoAsyncOpenAI maps HTTP-level status errors only.
For the full class reference, see AurikoAsyncOpenAI.

Configure manually

If you prefer to configure the SDK’s client directly, without the Auriko integration:
set_default_openai_api("chat_completions") is the default for the Agents SDK. Both Chat Completions and Response API streaming include routing_metadata.