Vercel AI SDK
The AI SDK is the fastest way to build your own agent on Depaza models. Use the @ai-sdk/openai-compatible provider.
Depaza API key
Model
Your key stays in this browser (local storage) and is sent only to depaza.eu. Every config block on this page fills in automatically. Don’t do this on a shared machine.
Keep DEPAZA_API_KEY server-side. Never ship it to a browser bundle. This is not Vercel’s AI Gateway — the provider talks to Depaza directly.
Install
npm i ai @ai-sdk/openai-compatible zod
Create the provider
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
export const depaza = createOpenAICompatible({
name: 'depaza',
baseURL: '{{BASE_URL}}',
apiKey: process.env.DEPAZA_API_KEY,
});
Generate and stream
import { generateText, streamText } from 'ai';
import { depaza } from './depaza';
const model = depaza('{{MODEL}}');
const { text } = await generateText({
model,
prompt: 'Explain what a GPU kernel is in two sentences.',
});
Tool calling
import { generateText, tool, stepCountIs } from 'ai';
import { z } from 'zod';
import { depaza } from './depaza';
const result = await generateText({
model: depaza('{{MODEL}}'),
prompt: 'What is the weather in Paris?',
stopWhen: stepCountIs(5),
tools: {
get_weather: tool({
description: 'Get the weather for a city',
inputSchema: z.object({ city: z.string() }),
execute: async ({ city }) => ({ city, temp: '18C' }),
}),
},
});