Helper utilities for routing LLM SDK clients through the Steward proxy.
Proxy Helpers
When using the Proxy Gateway, you need to configure LLM SDK clients to route through Steward instead of calling APIs directly. These helpers simplify that process.
Manual Configuration
Most LLM SDKs support custom base URLs. Configure them to point at the Steward proxy:
OpenAI
Anthropic
Generic fetch
import OpenAI from "openai";const openai = new OpenAI({ apiKey: "steward", // dummy — stripped by proxy baseURL: `${process.env.STEWARD_PROXY_URL}/openai/v1`,});// Use normally — proxy handles authenticationconst completion = await openai.chat.completions.create({ model: "gpt-4o", messages: [{ role: "user", content: "Hello" }],});