OpenAI TypeScript SDK with Wild West
The Node OpenAI client takes a baseURL in its constructor. Set it to Wild West and your chat.completions calls route through the gateway.
- Base URL
- https://wildwestapi.com/v1
- API key
- Get one, starts sk-ww-
- Example model
- glm-5.3-outlaw
baseURL and apiKey
TypeScript
// npm install openai import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://wildwestapi.com/v1", apiKey: "sk-ww-...", }); const resp = await client.chat.completions.create({ model: "glm-5.3-outlaw", messages: [{ role: "user", content: "Hello" }], }); console.log(resp.choices[0].message.content);
Use baseURL: "https://wildwestapi.com/v1" and apiKey for the key, or set OPENAI_BASE_URL and OPENAI_API_KEY in the environment. Stay on chat.completions.create; the Responses API is not served.