Hey there,
If you want to use a free image generator model for the AI AGENT SAAS Challenge instead of paid OpenAI, I recommend you to use Together AI
Steps:
- Run the following: npm install @ai-sdk/togetherai ai
- Then add this: const together = createTogetherAI({
apiKey: process.env.TOGETHER_API_KEY,
});
3. Then add this: //Generate the image using Together AI
const image = await generateImage({
model: togetherai.image("black-forest-labs/FLUX.1-schnell-Free"),
prompt: prompt,
size: IMG_SIZE,
n: 1,
Rest of yours code stays same