Veilفارسی

Vercel AI SDK with Veil API

Vercel AI SDK talks to Veil API in the OpenAI format. Change two settings and every Veil model is available.

Setup

  1. Create a Veil API key. Open the console
  2. Install Vercel AI SDK as usual.
  3. Point its base URL at Veil and use your Veil key, as below.
import { createOpenAI } from "@ai-sdk/openai";
import { generateText } from "ai";

const veil = createOpenAI({ baseURL: "https://api.veil.ir/v1", apiKey: process.env.VEIL_API_KEY });
const { text } = await generateText({ model: veil.chat("anthropic/claude-haiku-5-5"), prompt: "Hello" });

Which model

Any model id from the models page works. Veil routes it and bills it at its list price.

Browse models and prices