Playing with OpenAI

November 30, 2022


Generative AI is a hot topic these days, where companies like OpenAI, Midjourney, & Stability AI are providing capabilities that allow you to generate long-form text, images, & even code from simple text prompts.

To familiarize myself better in this space, I built a simple web app with OpenAI's APIs. TLDR: They do make it pretty easy to integrate into an application.

The web app

In addition to the OpenAI APIs, the project is built with Next.js & Chakra UI. Chakra UI is a React component library that allows you to build UI very quickly.

The web app configures two routes:

On both pages, you can enter a simple text prompt & then click on Submit to get the results.

Here's a short story example:

A short story created with Open AI

And here's an image example:

An image created with OpenAI

Final thoughts

OpenAI offers a pretty powerful set of tools for generative AI. However, it does come at a cost. First is the financial cost: You get an $18 credit when you create an account, but after that, you have to pay.

The second is more philosophical. There are legitimate concerns about generative AI tools like OpenAI. There's the issue of how copyrighted material is used to train the models, as described in this lawsuit against GitHub & OpenAI. The models can also generate offensive & false information: Meta's Galactica was taken down days after its release after heavy criticism from the scientists it was supposed to help. Galactica's mission is to "organize science" by summarizing literature, solving math problems, etc. Instead, it ended up outputting nonsense.

Nevertheless, there's a lot of interesting work happening in the space & it's important to play with these tools to understand the possibilities. The key is to develop generative AIs responsibly.