How to Add ChatGPT to a Microsoft Teams Channel
In this step-by-step guide, we’ll learn how to integrate ChatGPT into your Microsoft Teams channel.
2 Methods to Integrate ChatGPT to Microsoft Teams
- Third-Party Integrations:
- Power Automate: This Microsoft tool allows you to create custom workflows to connect ChatGPT to your Teams channels. This is a free option if you already have access to Power Automate through your Microsoft 365 subscription.
- Direct API Integration (Custom Development):
- For businesses with development resources, you can build a custom integration using the OpenAI API. This offers the most flexibility but requires technical expertise. OpenAI provides various pricing tiers for API usage based on usage volume and model selection.
In this guide, we’ll guide you to add ChatGPT into Microsoft Teams using Microsoft Power Automate.

How to Integrate ChatGPT to Microsoft Teams
Prerequisites
- OpenAI Account: Sign up for an OpenAI account and obtain an API key from the platform’s dashboard.
- Microsoft Power Automate Account: Ensure you have access to a Power Automate account within your Microsoft 365 subscription.

Detailed Steps
- Create a New Flow:
- Open Power Automate and click “Create” -> “Instant cloud flow.”
- Name your flow (e.g., “Teams ChatGPT Integration”).
- Choose “Manually trigger a flow” as the trigger and click “Create.”
- Add a “New Message Posted in a Channel” Trigger:
- Search for and select the “Microsoft Teams” connector.
- Choose the “When a new message is posted in a channel” trigger.
- Specify the Team and Channel where you want the bot to listen for messages.
- Add an “HTTP” Action to Send Message to ChatGPT API:
- Click “New step” and search for the “HTTP” connector.
- Select the “HTTP” action.
- Configure the HTTP action with the following details:
- Method: POST
- URI:
https://api.openai.com/v1/chat/completions
- Headers:
Content-Type
:application/json
Authorization
:Bearer YOUR_OPENAI_API_KEY
(ReplaceYOUR_OPENAI_API_KEY
with your actual API key)
- Body: Code snippet
{ "model": "gpt-3.5-turbo", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "@triggerBody()"} ] }
Use code with caution.content_copy- Replace
gpt-3.5-turbo
with the desired model (e.g.,gpt-4
if available). @triggerBody()
dynamically inserts the user’s message from Teams.
- Replace
- Parse JSON Response:
- Add a “Parse JSON” action from the “Data Operation” connector.
- Set the “Content” field to the “Body” output from the HTTP action.
- Set the “Schema” by generating from the sample output of the HTTP action (the ChatGPT response).
- Post Message to Teams:
- Add the “Post message in a chat or channel” action from the “Microsoft Teams” connector.
- Configure the action to post to the same Team and Channel as the trigger.
- In the “Message” field, reference the parsed JSON response to extract the ChatGPT answer (e.g.,
body('Parse_JSON')['choices'][0]['message']['content']
).
- Save and Test:
- Save your flow.
- Test it by sending a message in the specified Teams channel. You should receive a response from ChatGPT within Teams.
Additional Tips
- Error Handling: Add error handling steps to catch potential issues like API limits or incorrect input.
- Customization: Modify the
system
message or add more messages to themessages
array in the HTTP request body to customize the behavior and responses of ChatGPT. - Advanced Features: Explore options like conversation history, different OpenAI models, or incorporating other actions in your Power Automate flow to create more sophisticated integrations.
Important Notes:
- The API endpoint provided is correct for OpenAI’s GPT-3.5-turbo model. If you want to use a different model (e.g., gpt-4 if available), you would need to replace “gpt-3.5-turbo” with the desired model in the HTTP action body.
- The @triggerBody() function in the HTTP action body dynamically inserts the user’s message from Teams.
- The Parse JSON action is used to handle the output from the ChatGPT API.
- The Post Message to Teams action posts the response from ChatGPT to the same Team and Channel as the trigger.
- It’s important to add error handling steps to catch potential issues like API limits or incorrect input.
- You can customize the system message or add more messages to the messages array in the HTTP request body to customize the behavior and responses of ChatGPT.
- You can explore options like conversation history, different OpenAI models, or incorporating other actions in your Power Automate flow to create more sophisticated integrations.
Benefits of Microsoft Teams ChatGPT Integration
Integrating ChatGPT into Microsoft Teams supercharges your collaboration experience. Here’s how it transforms your teamwork:
Easier Communication:
- Quick Answers: Get instant responses to questions within Teams chats, saving you time and effort.
- Meeting Summaries: Automatically capture key points and decisions from meetings, ensuring everyone stays on track.
- No More Language Barriers: Real-time translation of messages bridges communication gaps in multilingual teams.
Productivity Boost:
- Automate the Boring Stuff: ChatGPT handles routine tasks like scheduling, reminders, and to-do lists so you can focus on the big picture.
- Unleash Creativity: Get help brainstorming ideas, exploring new perspectives, and finding innovative solutions.
- Writing Made Easy: Draft better emails, reports, or presentations with ChatGPT’s assistance.
Knowledge at Your Fingertips:
- Find Anything Fast: ChatGPT quickly digs up relevant information, eliminating the need for lengthy searches.
- Personalized Learning: Receive recommendations for learning resources tailored to your interests and needs.
- Share Expertise Effortlessly: ChatGPT answers questions and provides insights, fostering a culture of knowledge sharing.
Smarter Decisions:
- Data-Driven Insights: ChatGPT analyzes data to provide valuable insights for making informed decisions.
- Risk Assessment: Get help identifying potential risks and challenges related to your projects.
- Weigh Your Options: Explore the pros and cons of different choices to make the best decision.
More Inclusive Collaboration:
- Language Accessibility: Real-time translation bridges communication gaps, making teamwork inclusive for everyone.
- Support for All: ChatGPT offers alternative communication methods and tailored support for users with disabilities.
Conclusion
By leveraging Microsoft Teams ChatGPT integration, we hope you can transform how you work daily.
Olivia brings her AI research knowledge and background in machine learning/natural language processing to her role at Avada AI. Merging professional expertise in computer science with her passion for AI's impact on technology and human development, she crafts content that engages and educates, driven by a vision of the future shaped by AI technology.
Suggested Articles

ChatGPT’s Second Anniversary
May 27, 2024
5 min read

How to Use Kayak ChatGPT Plugin to Plan Your Trip
May 27, 2024
10 min read

How to Create a ChatGPT AI Discord Bot?
May 27, 2024
7 min read