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

# SDKs

> Call the LLM Gateway from the OpenAI, Anthropic, Vercel AI and LangChain SDKs

Point the SDK at the gateway and pass your [LLM Gateway key](https://docs.getunbound.ai/llm-gateway/keys.md#create-a-key). Use any model or [alias](https://docs.getunbound.ai/llm-gateway/models.md#aliases).

## OpenAI

```python Python theme={null}
from openai import OpenAI

client = OpenAI(base_url="https://api.getunbound.ai/v1", api_key="<your-key>")

response = client.chat.completions.create(
    model="claude-sonnet-4-6",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)
```

```typescript TypeScript theme={null}
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.getunbound.ai/v1", apiKey: "<your-key>" });

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

The SDK also reads `OPENAI_BASE_URL` and `OPENAI_API_KEY` from the environment.

## Anthropic

Use the root URL, without `/v1`.

```python Python theme={null}
from anthropic import Anthropic

client = Anthropic(base_url="https://api.getunbound.ai", api_key="<your-key>")

message = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)
print(message.content[0].text)
```

```typescript TypeScript theme={null}
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({ baseURL: "https://api.getunbound.ai", apiKey: "<your-key>" });

const message = await client.messages.create({
  model: "claude-sonnet-4-6",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hello" }],
});
console.log(message.content[0].text);
```

The SDK also reads `ANTHROPIC_BASE_URL` and `ANTHROPIC_API_KEY` from the environment.

## Vercel AI SDK

```typescript theme={null}
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";

const unbound = createOpenAICompatible({
  name: "unbound",
  baseURL: "https://api.getunbound.ai/v1",
  apiKey: process.env.UNBOUND_API_KEY,
});

const { text } = await generateText({
  model: unbound("claude-sonnet-4-6"),
  prompt: "Hello",
});
```

## LangChain

```python theme={null}
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    base_url="https://api.getunbound.ai/v1",
    api_key="<your-key>",
    model="claude-sonnet-4-6",
)
print(llm.invoke("Hello").content)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.