Do TypeScript types still work?
Yes. The response types are identical to OpenAI, so your existing type annotations work unchanged.
SDK Migration
The OpenAI Node SDK supports custom endpoints via baseURL. Switch to abliteration.ai without rewriting your application.
Your existing async/await patterns, streaming handlers, and TypeScript types work unchanged.
Switching the OpenAI Node SDK base URL means changing one parameter to route requests through an alternative OpenAI-compatible provider.
import OpenAI from "openai";
// Before: OpenAI default
// const client = new OpenAI({ apiKey: "sk-..." });
// After: abliteration.ai
const client = new OpenAI({
baseURL: "https://api.abliteration.ai/v1",
apiKey: process.env.ABLIT_KEY,
});
const completion = await client.chat.completions.create({
model: "abliterated-model",
messages: [{ role: "user", content: "Summarize this document." }],
});
console.log(completion.choices[0]?.message?.content);FAQ
Yes. The response types are identical to OpenAI, so your existing type annotations work unchanged.
Yes. Use stream: true and iterate over the async iterator exactly like OpenAI.
Yes. The SDK works in Next.js API routes, Server Actions, and Edge Runtime.