> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abliteration.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Node / TypeScript

> Use the official OpenAI or Anthropic JavaScript SDKs with abliteration.ai in Node, Edge, and Bun runtimes.

Use the official OpenAI or Anthropic JavaScript SDKs by pointing them at abliteration.ai.

## Install

```sh theme={"system"}
npm install openai
```

## OpenAI SDK

```javascript theme={"system"}
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.abliteration.ai/v1",
  apiKey: process.env.ABLIT_KEY,
});

const resp = await client.chat.completions.create({
  model: "abliterated-model",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(resp.choices[0].message.content);
```

## Streaming

```javascript theme={"system"}
const stream = await client.chat.completions.create({
  model: "abliterated-model",
  messages: [{ role: "user", content: "Write a haiku" }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0].delta.content ?? "");
}
```

## Edge runtimes

Works in Cloudflare Workers, Vercel Edge, and Bun. Use `fetch` directly if you want to avoid the SDK bundle:

```javascript theme={"system"}
const res = await fetch("https://api.abliteration.ai/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${env.ABLIT_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "abliterated-model",
    messages: [{ role: "user", content: "Hello" }],
  }),
});
```

See [Cloudflare Workers](/integrations/cloudflare-workers) and [Vercel AI SDK](/integrations/vercel-ai-sdk) for framework-specific setups.
