Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kazuma512/chatgpt-fastapi

This is a simple API project that calls the ChatGPT API using FastAPI.
https://github.com/kazuma512/chatgpt-fastapi

chatgpt-api fastapi kazuma512 python third-party-api

Last synced: about 2 months ago
JSON representation

This is a simple API project that calls the ChatGPT API using FastAPI.

Awesome Lists containing this project

README

        

# chatgpt-fastAPI

## Introduction
This is a simple API project that calls the ChatGPT API using FastAPI.

## Installation

```bash
pip install -r requirements.txt
```

## Usage

```python
async def ask_gpt(input_text):
completion = await client.chat.completions.create(model="gpt-3.5-turbo", messages=[{"role": "user", "content": input_text}])
return completion.choices[0].message.content
```