Deploy a ChatGPT API Server in no time

Need a ChatGPT API server for quick prototyping? Let’s make an endpoint and deploy it with Vercel, for free!

LIU YONGLIANG
2 min readFeb 22, 2023

Motivation

Need a ChatGPT API server for quick prototyping? Let’s make an endpoint and deploy it with Vercel, for free!

TLDR:

  • you get an endpoint that you can POST JSON to
  • the endpoint will return JSON with the response from “ChatGPT”
  • it’s done via OpenAI’s official text completion API
  • using the “text-davinci-003” model
  • OpenAI API is not free, but you are given some free credits to try it out
  • you will need OPENAI_API_KEY

Pre-requisites

  • Get a OpenAI API key
  • Have a GitHub account and a Vercel account that is linked to your GitHub account

Steps

If the prerequisites are met, you can simply click on this link to deploy. It will guide you through the process of cloning the repository and filling in the environment variable.

The exact steps are as follows:

  1. Clone/fork my template repository
  2. Go to the Vercel dashboard and click on “Add New…” to import your new repository
  3. Enter the environment variable OPENAI_API_KEY

--

--

LIU YONGLIANG

Computer Science Student @ National University of Singapore. Connect with me @ https://www.linkedin.com/in/-yong-/