Source: https://ailoot.ai/docs/en/integrations/vercel-ai-sdk/
Canonical: https://ailoot.ai/docs/en/integrations/vercel-ai-sdk/
Language: en

[SDKs and frameworks](https://ailoot.ai/docs/en/integrations/#sdk) 

# Vercel AI SDK

[Markdown](https://ailoot.ai/docs/en/integrations/vercel-ai-sdk/index.md)

SDK · OpenAI Chat, OpenAI Responses, Anthropic Messages, Gemini

| Format | Where to set it up |
| --- | --- |
| OpenAI Chat, OpenAI Responses, Anthropic Messages, Gemini | Providers: createOpenAICompatible({ name, baseURL, apiKey }) from @ai-sdk/openai-compatible; createAnthropic({ baseURL, apiKey }) from @ai-sdk/anthropic; createGoogleGenerativeAI({ baseURL, apiKey }) from @ai-sdk/google; createOpenAI({ baseURL }) or OPENAI\_BASE\_URL |

## [](https://ailoot.ai/docs/en/integrations/vercel-ai-sdk/#setup)Setup

Copy the configuration and replace `sk-...` with your key from the Ailoot Dashboard. Prefer storing the key in the environment variable `AILOOT_API_KEY`, if the application supports it.

Before starting, request GET /v1/models with your Ailoot key. Choose an exact model ID whose methods include POST /v1/chat/completions, POST /v1/responses, POST /v1/messages, POST /v1beta/models/{model}:generateContent, then use that ID in the configuration. For agents, also check tool support and the features required by your client version.

```js
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { createAnthropic } from "@ai-sdk/anthropic";
import { createGoogleGenerativeAI } from "@ai-sdk/google";
import { generateText } from "ai";

const ailoot = createOpenAICompatible({ name: "ailoot", baseURL: "https://api.ailoot.ai/v1", apiKey: process.env.AILOOT_API_KEY });
const claude = createAnthropic({ baseURL: "https://api.ailoot.ai/v1", apiKey: process.env.AILOOT_API_KEY });
const gemini = createGoogleGenerativeAI({ baseURL: "https://api.ailoot.ai/v1beta", apiKey: process.env.AILOOT_API_KEY });

const { text } = await generateText({ model: ailoot("deepseek-v4-pro"), prompt: "Hello" });
// claude("claude-sonnet-5-5"), gemini("gemini-3.6-flash")
```

This configuration reads the key from the environment variable `AILOOT_API_KEY`. Set it before starting the application:

```bash
export AILOOT_API_KEY="sk-..."   # add to ~/.zshrc or ~/.bashrc
```

```powershell
setx AILOOT_API_KEY "sk-..."   # then restart the terminal
```

Example model: `deepseek-v4-pro (OpenAI-compatible), claude-sonnet-5-5 (Anthropic), gemini-3.6-flash (Gemini)`. Choose any other model from the [catalog](https://ailoot.ai/models/en/) — check that it supports the format you need.

## [](https://ailoot.ai/docs/en/integrations/vercel-ai-sdk/#notes)Good to know

Providers use different URLs: OpenAI-compatible and Anthropic use /v1 (Anthropic defaults to https://api.anthropic.com/v1); Google uses /v1beta (default https://generativelanguage.googleapis.com/v1beta). The @ai-sdk/openai provider defaults to the Responses API. For models without responses, use openai.chat("id") or createOpenAICompatible.

## [](https://ailoot.ai/docs/en/integrations/vercel-ai-sdk/#check)Test

- For the OpenAI format, the URL is `https://api.ailoot.ai/v1` (or the full path if the application asks for a full URL).
- For the Anthropic format, the URL is `https://api.ailoot.ai` with the path `/v1`.
- For the Gemini format, the URL is `https://api.ailoot.ai` with the path `/v1beta`.
- Ask a short question. If you get an error, check the code and Request ID, then consult [Errors and limits](https://ailoot.ai/docs/en/errors/).
- 404 immediately after setup almost always means the URL is wrong: an extra or missing `/v1`.
- 402 — insufficient balance for the reserve. Agents reserve more than chat: [why](https://ailoot.ai/docs/en/billing/reserve/).

Application documentation: [https://ai-sdk.dev/providers/openai-compatible-providers](https://ai-sdk.dev/providers/openai-compatible-providers)

Still have questions? Send your Request ID and a description — we'll help you troubleshoot.[Contact support](mailto:support@ailoot.ai)

## Ailoot · The company and its project portfolio





Ailoot combines established operating experience, a large client base, stable service and ongoing KPI control.





The company and its project portfolio: millions of customers; monthly sales in the billions.





Ailoot brings that operating experience to API access for AI features in customer products, agents, applications and automations.
