How to Integrate LLM APIs with Replit & Watch Us Build an AI App
Last updated
April 29, 2025
Advertiser disclosure: some links on this website are affiliate links, meaning No Code MBA will make a commission if you click through and purchase.
Header 1
Header 2
Header 3
Header 4
Header 5
Header 6
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
In this tutorial, you’ll learn exactly how to integrate LLM APIs like OpenAI into the AI coding tool Replit to build a functional one-page AI app.
We’ll walk through the full process of building an AI makeup advisor, where users can upload or take a selfie, choose an occasion (e.g. work, party, date), and receive personalized feedback powered by OpenAI.
Follow along to learn the technical aspects of getting things working and be inspired by what AI apps are capable of.
Getting Started with Replit and OpenAI API
To begin our makeup advisor app, we'll use Replit, a powerful no-code platform that allows for AI coding and integration with AI services. Here's how to get started:
Visit replit.com and create a new project.
Describe your project idea to Replit's AI. In this case, we want "an AI makeup advisor where users can upload an image, click a 'get feedback' button, and receive makeup recommendations from OpenAI."
Provide your OpenAI API key when prompted.
It's that simple to set up the OpenAI API connection. However, there might be more that you need to do as we experienced while building out this app.
Replit will generate an initial prototype based on your description. However, you may need to make some adjustments to achieve the desired functionality.
Implementing Image Upload and Feedback
After Replit generates the initial prototype, you might notice that some features are missing or not working as expected. Here's how to refine your application:
If the "Get Feedback" button is missing, prompt Replit to add it.
Test the image upload functionality with a sample image.
If you encounter errors (e.g., "Request entity too large"), you may need to adjust the API integration.
To improve the API integration, consider using a pre-tested prompt from the OpenAI playground. This can help ensure that your application sends the correct data to the API and receives properly formatted responses.
Using OpenAI's playground
Enhancing User Experience with Structured Feedback
Once you've successfully integrated the OpenAI API, focus on improving the user experience by structuring the feedback in a clear, easy-to-read format. The AI's response should ideally include:
Overall impression
Strengths of the current makeup look
Areas for improvement
Specific recommendations
To achieve consistent formatting, you may need to refine your API prompt or implement additional processing of the API response within your Replit application.
Here's what the app looks like at this stage
Adding Advanced Features to Your AI Makeup Advisor
To make your AI makeup advisor more versatile and user-friendly, consider implementing these advanced features:
Step 1: Implement Occasion-Based Recommendations
Add a dropdown menu that allows users to select the occasion for their makeup look (e.g., work, party, date). This contextual information can help the AI provide more tailored recommendations.
Step 2: Integrate Camera Functionality
Enable users to take selfies directly within the application instead of only allowing image uploads. This feature can significantly improve the user experience and increase engagement with your app.
We added more functionality including the camera option
Step 3: Refine API Prompts for Better Results
Continuously improve your API prompts to get more accurate and helpful responses from the AI. Consider factors such as:
The user's skin type
Specific areas of focus (e.g., eyes, lips, contour)
Current makeup trends
Troubleshooting Common Issues
When integrating LLM APIs with Replit, you may encounter some challenges. Here are some common issues and how to address them:
Request Entity Too Large Error
If you receive this error when uploading images, you may need to compress the images before sending them to the API or adjust the file size limits in your Replit application.
Inconsistent API Responses
To ensure more consistent responses from the AI, consider using a structured output format like JSON. This can help you parse and display the information more reliably in your application.
Performance Issues
If your application is slow to respond, you may need to optimize your API calls or implement caching mechanisms to improve performance.
Future Improvements and Potential Applications
The AI makeup advisor we've created is just the beginning. There are many ways to expand and improve upon this concept:
Implement specific product recommendations based on the user's skin type and preferences
Create specialized versions for specific makeup categories (e.g., eye makeup, lip products)
Integrate user accounts to save preferences and track progress over time
Incorporate augmented reality features to allow users to virtually try on recommended makeup looks
The possibilities for no-code AI applications are vast, and platforms like Replit make it easier than ever to bring these ideas to life.
Ready to take your no-code skills to the next level? Sign up for No Code MBA and access dozens of in-depth, high-quality courses on no-code and AI taught by industry experts. Join No Code MBA today and start building your own AI-powered applications!
No, Replit is designed for users with little to no coding experience. Its intuitive interface and AI-assisted development process make it accessible to beginners.
Can I use other AI services besides OpenAI with Replit?
While this tutorial focuses on OpenAI, Replit supports integration with various AI services. Check Replit's documentation for a full list of supported integrations.
How can I improve the accuracy of AI recommendations in my makeup advisor app?
To improve accuracy, refine your API prompts, provide more context in user inputs (such as skin type or occasion), and consider implementing a feedback loop where users can rate the AI's recommendations.
Is it possible to monetize an AI makeup advisor app created with Replit?
Yes, there are several ways to monetize such an app, including subscription models, in-app purchases for premium features, or partnerships with makeup brands for product recommendations.