See the API docs. For openai 4.x:
import OpenAI from "openai";
const openai = new OpenAI();
async function main() {
const image = await openai.images.generate({ prompt: "A cute baby sea otter" });
console.log(image.data);
}
main();
See the API docs. For openai 4.x:
import OpenAI from "openai";
const openai = new OpenAI();
async function main() {
const image = await openai.images.generate({ prompt: "A cute baby sea otter" });
console.log(image.data);
}
main();