Integrations
Vercel AI SDK
Use Setu models with generateText and streamText through the OpenAI provider.
Setup
Point the OpenAI provider at Setu and use .chat(model): Setu serves the Chat Completions API, not the newer Responses API that the provider uses by default.
npm install ai @ai-sdk/openaiimport { createOpenAI } from '@ai-sdk/openai';
import { generateText, streamText } from 'ai';
const setu = createOpenAI({
baseURL: 'https://setu.supremeai.services/api/setu/v1',
apiKey: process.env.SETU_API_KEY,
});
// Use .chat(): Setu serves the Chat Completions API, not the Responses API.
const { text } = await generateText({
model: setu.chat('quantum-lite'),
prompt: 'Give me three names for a tea shop in Ilam.',
});
const result = streamText({ model: setu.chat('quantum-lite'), prompt: 'Explain momo in one paragraph.' });
for await (const part of result.textStream) process.stdout.write(part);