This tutorial shows how to connect ChatGPT to a Replit project using Replit's built-in AI integration, so you can add conversational AI features to your app without leaving your workspace.
Notes:
- The built-in ChatGPT integration (Replit-managed) requires a paid Replit plan and bills usage through your Replit credits.
- When the Agent detects an OpenAI dependency, it will display a confirmation prompt showing "OpenAI (Replit managed)." Click Approve to let Replit handle the API credentials automatically.
- Your OpenAI API key is automatically stored in the Secrets pane. You can update or replace it there at any time. See How to Set Environment Variables in Replit for more on Secrets.
- Sign in at replit.com and open the project you want to add ChatGPT to, or click + Create Something New to start a fresh one.
- In the Agent prompt field, describe what you want to build and mention ChatGPT directly - for example: Build a ChatGPT-powered internal Q&A assistant for NEPS Corp that answers questions about company policies and procedures. Click the Arrow button to run.
- The Agent generates your project files and wires up the ChatGPT connection. Wait for the build to complete.
- Click Run to launch your app. Test it in the Preview tab - for example, type "What is the leave policy?" and confirm a relevant response appears.
.gif)
