https://github.com/hocgin/vercel-chatgpt
one step, chatgpt api in serverless
https://github.com/hocgin/vercel-chatgpt
chatgpt chatgpt-api vercel
Last synced: about 1 year ago
JSON representation
one step, chatgpt api in serverless
- Host: GitHub
- URL: https://github.com/hocgin/vercel-chatgpt
- Owner: hocgin
- Created: 2022-12-08T02:07:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-05T14:09:58.000Z (over 3 years ago)
- Last Synced: 2025-03-25T10:11:42.465Z (about 1 year ago)
- Topics: chatgpt, chatgpt-api, vercel
- Language: TypeScript
- Homepage: https://vercel-chatgpt.vercel.app/api?ask=%E4%BB%80%E4%B9%88%E6%98%AFJava
- Size: 102 KB
- Stars: 19
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chatgpt on Vercel


> Easily chatgpt/openai api as a
## Usage
service. [](https://vercel.com/new/clone?repository-url=https://github.com/hocgin/vercel-chatgpt)
```bash
curl https://${your_vercel_chatgpt}.vercel.app/api?ask=${your_ask}
```
## Example
### Input
```bash
# chatgpt
curl https://vercel-chatgpt.vercel.app/api?ask=什么是Java
# or openai
curl https://vercel-chatgpt.vercel.app/api/openai?ask=什么是Java
# or chatgpt3.5-turbo
curl https://vercel-chatgpt.vercel.app/api/chatgpt?ask=什么是Java
```
### Output
```json
{
"status": 200,
"success": true,
"message": "ok",
"data": "Java 是一种广泛使用的编程语言,它可以用于开发各种各样的应用程序,包括移动应用、企业级应用和 Web 应用程序。Java 是一种面向对象的语言,它拥有丰富的类库和工具,可以帮助开发人员更快速地开发应用程序。Java 是跨平台的,这意味着可以在多种操作系统上运行,包括 Windows、macOS 和 Linux 等。Java 程序通常使用一个独立的 Java 虚拟机来执行,这样就可以保证程序在不同平台上的一致性"
}
```
## Deploy your own instance
[](https://vercel.com/new/clone?repository-url=https://github.com/hocgin/vercel-chatgpt)
Vercel ENV:
```env
SESSION_TOKEN=${your_session_token}
// or openai
OPENAI_TOKEN=${your_openai_token}
```
## License
MIT