{"id":13862283,"url":"https://github.com/gajosu/chat-gpt-rest-api","last_synced_at":"2025-07-14T11:33:11.304Z","repository":{"id":168837358,"uuid":"644629307","full_name":"gajosu/chat-gpt-rest-api","owner":"gajosu","description":"REST API for interacting with Chat GPT, a conversational AI powered by GPT. It allows you to send prompts and receive responses from the Chat GPT model.","archived":true,"fork":false,"pushed_at":"2023-07-20T19:55:59.000Z","size":72,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-05T06:05:32.781Z","etag":null,"topics":["chatgpt","chatgpt-api","chatgpt-app","chatgpt-bot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gajosu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-23T23:38:29.000Z","updated_at":"2024-04-27T01:45:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8de26ce-4243-4ab5-8526-85fa52e38af1","html_url":"https://github.com/gajosu/chat-gpt-rest-api","commit_stats":null,"previous_names":["gajosu/chat-gpt-api-rest","gajosu/chat-gpt-rest-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajosu%2Fchat-gpt-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajosu%2Fchat-gpt-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajosu%2Fchat-gpt-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajosu%2Fchat-gpt-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gajosu","download_url":"https://codeload.github.com/gajosu/chat-gpt-rest-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225974400,"owners_count":17553944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","chatgpt-api","chatgpt-app","chatgpt-bot"],"created_at":"2024-08-05T06:01:41.135Z","updated_at":"2024-11-22T22:30:53.127Z","avatar_url":"https://github.com/gajosu.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Chat GPT REST API\n\nThis project provides a REST API for interacting with Chat GPT, a conversational AI powered by GPT. It allows you to send prompts and receive responses from the Chat GPT model.\n\n\n## Content Table\n- [Api documentation](#api-documentation)\n  - [Get Conversations](#get-conversations)\n  - [New Conversation](#new-conversation)\n  - [Ask](#ask)\n  - [Delete Conversation](#delete-conversation)\n  - [Delete All Conversations](#delete-all-conversations)\n  - [Get Messages](#get-messages)\n\n\n\n## Api documentation\n\n### Get Conversations\n\nReturn a list of conversations.\n\nGET `/conversations`\n\nResponse: `200`\n```json\n[\n  {\n    \"id\": \"d6bd2590-01f4-32b7-b1y3-c5ea1fr7r819\",\n    \"title\": \"Conversation 1\",\n    \"create_time\": \"2023-05-28T17:13:08.233528+00:00\",\n    \"update_time\": \"2023-05-28T17:13:24+00:00\",\n    \"mapping\": null,\n    \"current_node\": null\n  },\n  ...\n]\n```\n### New Conversation\n\nCreate a new conversation and ask the first question.\n\nPOST `/conversations/new`\n\n## Request Body\n\n| Parameter        | Type   | Required | Description                            |\n|------------------|--------|----------|----------------------------------------|\n| `prompt`         | string | Yes      | The prompt message for the conversation |\n| `title`          | string | No       | The title of the conversation |\n| `model`          | string | No       | The model to use for the conversation |\n| `autocontinue`   | string | No       | Whether to automatically continue the conversation, must be `true` or `false` |\n\nResponse: `201`\n```json\n{\n  \"response\": {\n    \"author\": {\n      \"role\": \"assistant\",\n      \"name\": null,\n      \"metadata\": {}\n    },\n    \"message\": \"¡Sure, I can help you with that! What is your name?\",\n    \"conversation_id\": \"c6b0aeef-b322-4f47-a9f8-7e52ebca942a\",\n    \"parent_id\": \"07cd64d2-da49-4b39-a652-a69b31eede06\",\n    \"model\": \"text-davinci-002-render-sha\",\n    \"finish_details\": \"stop\",\n    \"end_turn\": false,\n    \"recipient\": \"all\",\n    \"citations\": []\n  }\n}\n```\n\n### Ask\n\nAsk a question to the conversation.\n\nPOST `/conversations/{conversation_id}/ask`\n\n#### Body Parameters\n\n| Parameter        | Type   | Required | Description                            |\n|------------------|--------|----------|----------------------------------------|\n| `prompt`         | string | Yes      | The prompt message for the conversation |\n| `parent_id`      | string | No       | UUID for the message to continue on |\n| `model`          | string | No       | The model to use for the conversation |\n| `autocontinue`   | string | No       | Whether to automatically continue the conversation, must be `true` or `false` |\n\n\nResponse: `201`\n```json\n{\n  \"response\": {\n    \"author\": {\n      \"role\": \"assistant\",\n      \"name\": null,\n      \"metadata\": {}\n    },\n    \"message\": \"¡Sure, I can help you with that! What is your name?\",\n    \"conversation_id\": \"c6b0aeef-b322-4f47-a9f8-7e52ebca942a\",\n    \"parent_id\": \"07cd64d2-da49-4b39-a652-a69b31eede06\",\n    \"model\": \"text-davinci-002-render-sha\",\n    \"finish_details\": \"stop\",\n    \"end_turn\": false,\n    \"recipient\": \"all\",\n    \"citations\": []\n  }\n}\n```\n\n### Delete Conversation\n\nDelete a conversation.\n#### URL\n\nDELETE `/conversations/{conversation_id}`\n\nResponse: `204 No Content`\n\n\n### Delete All Conversations\n\nDelete all conversations.\n\nDELETE `/conversations/all`\n\nResponse: `204 No Content`\n\n### Get Messages\n\nGet all messages from a conversation.\n\nGET `/conversations/{conversation_id}/messages`\n\nResponse: `200`\n```json\n[\n  {\n    \"author\": {\n      \"role\": \"assistant\",\n      \"name\": null,\n      \"metadata\": {}\n    },\n    \"message\": \"¡Sure, I can help you with that! What is your name?\",\n    \"conversation_id\": \"c6b0aeef-b322-4f47-a9f8-7e52ebca942a\",\n    \"parent_id\": \"07cd64d2-da49-4b39-a652-a69b31eede06\",\n    \"model\": \"text-davinci-002-render-sha\",\n    \"finish_details\": \"stop\",\n    \"end_turn\": false,\n    \"recipient\": \"all\",\n    \"citations\": []\n  },\n  ...\n]\n```\n\n## Authentication\nThe API requires authentication using an access token. You need to include the Authorization header with the value set to your access token in each request.\n#### Request Headers\n\n| Header          | Description                           |\n|-----------------|---------------------------------------|\n| `Authorization` | Access token for authentication       |\n\nFor obtaining an access token, you need be logged in to your OpenAI account and go to the sesion endpoint.\n\nhttps://chat.openai.com/api/auth/session\n\nCopy the value of the `accessToken` field and use it as the value of the Authorization header.\n\n## Rate Limiting\n\nOpenAI has a rate limit of 50 requests per hour. If you exceed this limit, you will receive a `500` response code with the error message `Rate limit exceeded`.\n\n## Getting Started\n\nTo get started with the Chat GPT API, follow these steps:\n\n1. Install the required dependencies by running:\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n2. Run the server:\n    ```bash\n    python manage.py runserver\n    ```\n\n3. You can now send requests to the API at `http://localhost:8000`\n\n\n## License\n\nThis project is licensed under the terms of the GPL-2.0 license. See the [LICENSE](LICENSE) file for details.\n\n## Disclaimers\n\nThis project is in no way affiliated with, associated with, authorized by, endorsed by, or officially affiliated in any way with OpenAI, Inc. (www.openai.com).\nThis project uses a public npm package called [revChatGPT](https://github.com/acheong08/ChatGPT) to interact with the OpenAI API.\nI am not responsible for possible bans or suspensions of your OpenAI account. Use this project at your own risk.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajosu%2Fchat-gpt-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgajosu%2Fchat-gpt-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajosu%2Fchat-gpt-rest-api/lists"}