Skip to content

One-click deploy "ChatGPT" API server powered by OpenAI's Text Completion API (require API key)

Notifications You must be signed in to change notification settings

tlylt/chatgpt-nextjs-server

Repository files navigation

"ChatGPT" API Server with Next.js

  • via OpenAI's official text completion API
  • using "text-davinci-003"
  • not free, but you have some free credits to try it out
  • need OPENAI_API_KEY
  • Powered by transitive-bullshit/chatgpt-api

To deploy your instance of this API with Vercel, either click this button

Deploy with Vercel

or follow these steps:

  • clone/fork this repository
  • import this project into Vercel
  • enter the environment variable OPENAI_API_KEY = your_openai_api_key
  • API will be available at https://your-vercel-project-name.vercel.app/api/chat
    • Note that the above URL is just an example. You can find your own URL in the Vercel dashboard.

API usage

{
    "message": "Hello, how are you?"
}

e.g. curl

curl -i -X POST \
   -H "Content-Type:application/json" \
   -d \
'{
    "message": "Can you chat?"
}' \
 'https://your-vercel-project-name.vercel.app/api/chat'
  • Response
{
    "response": "I can chat, but I'm not sure what you mean."
}

About

One-click deploy "ChatGPT" API server powered by OpenAI's Text Completion API (require API key)

Topics

Resources

Stars

Watchers

Forks