https://github.com/zeeshanahmad4/flaskgpt-api
FlaskGPT-API is a powerful RESTful API for utilizing ChatGPT models using Flask and Python, effortlessly integrate ChatGPT into your applications.
https://github.com/zeeshanahmad4/flaskgpt-api
apis artificial-intelligence chatbot chatgpt chatgpt-api flask gpt-4 openai python restful-api
Last synced: about 2 months ago
JSON representation
FlaskGPT-API is a powerful RESTful API for utilizing ChatGPT models using Flask and Python, effortlessly integrate ChatGPT into your applications.
- Host: GitHub
- URL: https://github.com/zeeshanahmad4/flaskgpt-api
- Owner: Zeeshanahmad4
- Created: 2023-06-06T03:40:02.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-16T08:22:43.000Z (about 3 years ago)
- Last Synced: 2025-02-07T12:39:55.353Z (over 1 year ago)
- Topics: apis, artificial-intelligence, chatbot, chatgpt, chatgpt-api, flask, gpt-4, openai, python, restful-api
- Language: Python
- Homepage:
- Size: 25.4 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FlaskGPT-API
FlaskGPT-API is a Python microservice built using the Flask framework that empowers developers to smoothly integrate ChatGPT services into their applications for end-users. It not only manages the authentication token but also modifies the incoming requests before routing them to the ChatGPT API. By leveraging this microservice, developers can avoid exposing their API keys to users, thereby offering a secure means to introduce ChatGPT functionalities into their apps.
## Key Features
- User authentication.
- Secured handling of ChatGPT API requests with OpenAI.
- SQLite database to store user data, conversation logs, and authentication details.
- Usage of Celery tasks to asynchronously manage resource-demanding tasks.
- Comprehensive logging for future analysis and improvement.
- Supports both free and premium subscription tiers, each with its own usage restrictions.
## Installation
To install FlaskGPT-API, follow these steps:
1. Clone the repository:
bashCopy code
`git clone https://github.com/yourusername/flaskgpt-api.git`
2. Navigate into the cloned directory:
bashCopy code
`cd flaskgpt-api`
3. Install the necessary dependencies:
bashCopy code
`pip install -r requirements.txt`
4. Make sure to insert your OpenAI API key into the settings.py file:
pythonCopy code
`OPENAI_API_KEY = "your-openai-api-key"`
5. Run the application:
bashCopy code
`python app.py`
## API Endpoints
FlaskGPT-API can be interacted with via the following API endpoints:
1. Authenticate user: POST /authenticate//
2. Process ChatGPT query: POST /query/////
3. Retrieve user chat: GET /chats//
4. Create a new user: POST /users/create
Please refer to the API documentation for more details on request and response structures.
## Requirements
- Flask
- Celery
- SQLite
- OpenAI
## Contributions
Your contributions are always welcome! Feel free to submit a pull request or raise an issue.
## License
This project is licensed under the terms of the MIT license.