---
title: "Vercel AI SDK"
description: "Configure the Vercel AI SDK to call plaingateway."
---

# Vercel AI SDK

Install `ai` and `@ai-sdk/openai-compatible`, export `PLAINGATEWAY_API_KEY`, then:

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

const plaingateway = createOpenAICompatible({
  name: "plaingateway",
  apiKey: process.env.PLAINGATEWAY_API_KEY,
  baseURL: "https://api.plaingateway.com/api/v1",
});
const { text } = await generateText({
  model: plaingateway("openai/gpt-5.6-luna"),
  prompt: "Say hello in five words.",
});
console.log(text);
```
