-
I tried to generate an image following the example here https://sdk.vercel.ai/docs/guides/providers/openai |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
@chejil I am looking for a way to generate images using dall-e 3 in vercel AI SDK, but I couldn't find any example, the link you posted does not have any example for generating images. could you please let me know which example or guide did you follow to using |
Beta Was this translation helpful? Give feedback.
-
just call openai sdk directly, cant really be streamed anyway so just await the response: const response = await openai.images.generate({
model: "dall-e-3",
prompt: "enter prompt here",
n: 1,
style: "natural",
size: "1792x1024",
})
return response.data[0].url and just put this a server action |
Beta Was this translation helpful? Give feedback.
-
Starting with AI SDK |
Beta Was this translation helpful? Give feedback.
Starting with AI SDK
4.0.14
we have image generation support: https://sdk.vercel.ai/docs/ai-sdk-core/image-generation