Skip to content

Instantly share code, notes, and snippets.

@1998code
Created July 10, 2022 01:56
Show Gist options
  • Save 1998code/ed81862883c1b97a1210a47439a9edd2 to your computer and use it in GitHub Desktop.
Save 1998code/ed81862883c1b97a1210a47439a9edd2 to your computer and use it in GitHub Desktop.
DALL-E 2 API
import { Dalle } from "dalle-node"
export default async function handler(req, res) {
const dalle = new Dalle(req.query.k);
const generations = await dalle.generate(req.query.q);
res.status(200).json({ result: generations })
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment