Learn to boost your app’s AI abilities with our guide to integrating the ChatGPT API through building an OpenAI plugin. #OpenAIplugin

language models like ChatGPT are constantly improving, and the integration of third-party plugins will only enhance its capabilities further. With the ability to retrieve real-time information, access knowledge-base information, and perform actions on behalf of the user, ChatGPT can offer a more comprehensive and personalized user experience.
Plugin developers play a crucial role in this process, as they expose API endpoints and define the plugin’s functionality, allowing ChatGPT to make calls and perform actions. The standardized manifest file and OpenAPI specification ensure consistency and accuracy across different plugins, enabling ChatGPT to seamlessly integrate with various applications.
As an intelligent API caller, ChatGPT proactively uses its natural language processing capabilities to interact with these plugins. For example, it can call a hotel reservation plugin API to answer a user’s question about where to stay in Paris, combining the API data and its own language capabilities to generate a comprehensive answer.
As this system continues to evolve, we anticipate more advanced use cases to emerge. With ChatGPT’s ability to handle complex and dynamic language, coupled with its integration with third-party plugins, the possibilities for personalized and intelligent interactions are endless.
Understanding the OpenAI Plugin Flow: A Comprehensive Guide
To create a plugin, it is essential to have a clear understanding of the end-to-end flow. Let’s explore each step in detail:
Table of Contents
1. Create a manifest file and host it at yourdomain.com/.well-known/ai-plugin.json
- In order to develop a plugin, it is crucial to have a comprehensive understanding of the entire process. The initial step is to create a manifest file and then host it on your domain by placing it at yourdomain.com/.well-known/ai-plugin.json.
- This manifest file contains important metadata pertaining to your plugin such as its name, logo, and other relevant details. Additionally, it also includes information about the authentication process required, such as the type of authentication and OAuth URLs. Moreover, an OpenAPI specification for the endpoints that you intend to make available is also included.
- The OpenAPI description fields play a key role as they provide a natural language description of the various fields which can be used by the model. It is recommended that initially, only one or two endpoints be exposed with a minimum number of parameters to ensure that the length of the text is minimized.
- Furthermore, it is important to note that the plugin description, API requests, and API responses are all integrated into the conversation with ChatGPT. This should be taken into consideration as it counts against the context limit of the model.
2. Register your plugin in the ChatGPT UI
- select the plugin model from the top drop-down menu. Next, choose the “Plugins” option, then select “Plugin Store,” and finally, click on either “Install an unverified plugin” or “Develop your own plugin.”
- If the plugin requires authentication, you will need to provide an OAuth 2 client_id and client_secret or an API key. This will ensure that only authorized users can access and use the plugin.
3. Users activate your plugin
- In order for users to use your plugin within the ChatGPT UI, they must manually activate it. ChatGPT does not use plugins by default. During the alpha testing phase, plugin developers will have the ability to share their plugins with up to 15 additional users. However, only other developers will be able to install unverified plugins at this time.
- As we continue to develop the platform, we will introduce a process for submitting your plugin for review. Once approved, your plugin will be available to all of ChatGPT’s user base.
- If your plugin requires authentication, users will be redirected via OAuth to your plugin. Additionally, you will have the option to allow users to create new accounts within your plugin.
- As the platform evolves, we plan to incorporate features that help users discover useful and popular plugins more easily.
4. Users begin a conversation
- As part of the integration process, OpenAI will include a concise description of your plugin in a message to ChatGPT. This information will be invisible to end users and will consist of your plugin’s description, endpoints, and examples.
- If a user asks a question that is relevant to your plugin, the model may choose to invoke an API call from your plugin if it deems it appropriate. For POST requests, we require that developers build a user confirmation flow to ensure the user wants to proceed with the action.
- The model will incorporate the results from the API call into its response to the user. If the API call returns any links, they will be displayed as rich previews using the OpenGraph protocol. This allows users to easily preview the site name, title, description, image, and URL of the linked content.
As part of the Plugin conversation header, Currently, it could include the user’s country and state information. For instance, if the user is in California, it will be represented as {“open-subdivision-1-iso-code”: “US-CA”}.
For accessing additional data sources, users will have to give their consent by opting in via a consent screen. This feature will be useful for a variety of use cases such as shopping, restaurants, weather updates, and more.
In conclusion, creating a plugin for ChatGPT can be a great way to add value to users. Understanding the end-to-end flow is critical to ensure that your plugin functions smoothly.

FAQs related to the plugin flow:
1. What is a plugin manifest file?
A plugin manifest file is a file that includes metadata about your plugin, details about the authentication required, and an OpenAPI spec for the endpoints you want to expose.
2. How many endpoints should I expose initially?
We suggest exposing only 1-2 endpoints in the beginning with a minimum number of parameters to minimize the length of the text.
3. How do I register my plugin in ChatGPT UI?
You can register your plugin by selecting the plugin model from the top drop-down, then select “Plugins”, “Plugin Store”, and finally “Install an unverified plugin” or “Develop your own plugin”.
4. How do users activate my plugin?
Users must manually activate your plugin in the ChatGPT UI. (ChatGPT will not use your plugin by default.)
5. How can I share my plugin during the alpha phase?
During the alpha, plugin developers will be able to share their plugin with 15 additional users (only other developers can install unverified plugins currently).
6. Can I submit my plugin for review to be exposed to all of ChatGPT’s user base?
Over time we will roll out a way to submit your plugin for review to be exposed to all of ChatGPT’s user base.
7. How does the plugin conversation header work?
Currently, we will be sending the user’s country and state in the Plugin conversation header. For further data sources, users will have to opt-in via a consent screen.
8. How can I provide a natural language description for the different fields?
You can use the OpenAPI description fields to provide a natural language description for the different fields.