#Connect API from chatgpt
1 messages · Page 1 of 1 (latest)
Hi @dim venture. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
To connect your plugin to the ChatGPT API, you'll need to follow a few steps:
-
Create a manifest file and host it at
yourdomain.com/.well-known/ai-plugin.json. This file includes metadata about your plugin (name, logo, etc.), details about authentication required (type of auth, OAuth URLs, etc.), and an OpenAPI spec for the endpoints you want to expose. The model will see the OpenAPI description fields, which can be used to provide a natural language description for the different fields. You should expose only 1-2 endpoints in the beginning with a minimum number of parameters to minimize the length of the text (source (https://platform.openai.com/docs/plugins/introduction)). -
Register your plugin in the ChatGPT UI (https://chat.openai.com). Select the plugin model from the top drop down, then select “Plugins”, “Plugin Store”, and finally “Develop your own plugin”. If authentication is required, provide an OAuth 2
client_idandclient_secretor an API key (source (https://platform.openai.com/docs/plugins/introduction)). -
Users activate your plugin. Users must manually activate your plugin in the ChatGPT UI. If OAuth is required, users will be redirected via OAuth to your plugin to sign in (source (https://platform.openai.com/docs/plugins/introduction)).
- Set up a local proxy of your public API. If the plugin is running on a remote server, you will need to first select “Develop your own plugin” to set it up and then “Install an unverified plugin” to install it for yourself. You can simply add the plugin manifest file to the
yourdomain.com/.well-known/path and start testing your API. However, for subsequent changes to your manifest file, you will have to deploy the new changes to your public site which might take a long time. In that case, setting up a local server to act as a proxy for your API is suggested. This allows you to quickly prototype changes to your OpenAPI spec and manifest file (source (https://platform.openai.com/docs/plugins/getting-started)).
As for the ChatGPT API, you can access it by integrating it into your own applications, products, or services. Please note that the ChatGPT API is not included in the ChatGPT Plus subscription and are billed separately. The API has its own pricing, which can be found at <https://openai.com/pricing.> The ChatGPT Plus subscription covers usage on chat.openai.com only and costs $20/month (source (https://help.openai.com/en/articles/7039783-how-can-i-access-the-chatgpt-api)).
Please note that the server API does not necessarily have to be a public domain name (source (https://community.openai.com/t/551300)).
Remember to update your manifest files manually by going through the "Develop your own plugin" flow in the plugin store each time you make a change to the ai-plugin.json file. ChatGPT will automatically fetch the latest OpenAPI spec each time a request is made so changes made will propagate to end users immediately (source (https://platform.openai.com/docs/plugins/production)).
If you encounter any issues, you can refer to the OpenAI community for help (source (https://community.openai.com/t/318145)).
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@dim venture kapa.ai is still learning and improving, please let us know how it did by reacting below