12 lines
349 B
TypeScript
12 lines
349 B
TypeScript
import { createOpenAI } from '@ai-sdk/openai';
|
|
import { generateText } from 'ai';
|
|
|
|
async function test() {
|
|
const customClient = createOpenAI({
|
|
baseURL: 'https://openrouter.ai/api/v1',
|
|
apiKey: process.env.OPENAI_API_KEY, // Assume I can't read it but I will use the one I fetch
|
|
});
|
|
|
|
// We need to fetch the API key from DB directly
|
|
}
|