Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vikyw89/openai-playground
https://github.com/vikyw89/openai-playground
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/vikyw89/openai-playground
- Owner: vikyw89
- License: mit
- Created: 2023-09-15T10:09:17.000Z (over 1 year ago)
- Default Branch: alpha
- Last Pushed: 2023-09-15T11:35:47.000Z (over 1 year ago)
- Last Synced: 2024-11-10T20:43:07.488Z (2 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenAI API Quickstart - Node.js example app
This is an example pet name generator app used in the OpenAI API [quickstart tutorial](https://platform.openai.com/docs/quickstart). It uses the [Next.js](https://nextjs.org/) framework with [React](https://reactjs.org/). Check out the tutorial or follow the instructions below to get set up.
![Text box that says name my pet with an icon of a dog](https://user-images.githubusercontent.com/10623307/213887080-b2bc4645-7fdb-4dbd-ae42-efce00d0dc29.png)
## Setup
1. If you don’t have Node.js installed, [install it from here](https://nodejs.org/en/) (Node.js version >= 14.6.0 required)
2. Clone this repository
3. Navigate into the project directory
```bash
$ cd openai-quickstart-node
```4. Install the requirements
```bash
$ npm install
```5. Make a copy of the example environment variables file
On Linux systems:
```bash
$ cp .env.example .env
```
On Windows:
```powershell
$ copy .env.example .env
```
6. Add your [API key](https://platform.openai.com/account/api-keys) to the newly created `.env` file7. Run the app
```bash
$ npm run dev
```You should now be able to access the app at [http://localhost:3000](http://localhost:3000)! For the full context behind this example app, check out the [tutorial](https://platform.openai.com/docs/quickstart).