Ai Coding Tools

How to Code Your First AI-Powered App in Under 2 Hours

By BTW Team5 min read

Comparing tools? See the AI tools tested on the show.

In short

A step-by-step tutorial detailing how to create your first AI-powered app using readily available tools, designed for those with little to no coding experience.

As a beginner, diving into the world of AI can feel overwhelming, especially if you're trying to build your first AI-powered app. You might be thinking, "Can I really do this in under two hours?" The answer is yes, but only if you have the right tools and a clear plan. In this guide, I’ll walk you through the essential steps and tools to get your first AI app up and running quickly.

Prerequisites: What You Need Before You Start

Before you dive in, here’s what you’ll need:

  1. Basic Programming Knowledge: Familiarity with Python is a plus, but many of these tools simplify coding.
  2. An IDE: Download Visual Studio Code (VS Code) for coding. It's free and user-friendly.
  3. An OpenAI API Key: Sign up for OpenAI to access their AI models. The free tier is sufficient for this project.
  4. A GitHub Account: For version control and collaboration, if needed.

Step 1: Choose Your AI-Powered Tool

Selecting the right tools is crucial for a smooth development process. Here’s a breakdown of some popular AI coding tools that can help you build your app.

| Tool Name | Pricing | Best For | Limitations | Our Take | |-------------------|----------------------------|--------------------------------|------------------------------------------|----------------------------------------| | OpenAI API | Free tier + $100/mo | Natural Language Processing | Limited free usage, costs can add up | We use it for generating text | | Hugging Face | Free, Pro starts at $9/mo | NLP and image processing | Requires some ML knowledge | Great for quick prototyping | | Streamlit | Free, Pro $29/mo | Building data apps quickly | Not suitable for heavy traffic | Perfect for quick demos | | Teachable Machine | Free | Image classification | Limited customization | Great for beginners without coding | | Google Cloud AI | Free tier + pay as you go | Comprehensive AI solutions | Can get expensive with heavy usage | Good for scaling, but complex to set up| | Microsoft Azure AI| Free tier + pay as you go | Enterprise solutions | Learning curve for new users | We don’t use it due to complexity | | Dialogflow | Free tier, $0-150/mo | Chatbots | Limited to conversational AI | Good for simple bots | | TensorFlow.js | Free | Web-based machine learning | Requires more coding knowledge | We use it for custom models | | IBM Watson | Free tier + $0-120/mo | Various AI applications | Pricing can be confusing | We don’t use it due to complexity | | PyTorch | Free | Deep learning | Requires more setup and knowledge | Not our first choice for simple apps | | RapidAPI | Free tier + usage-based | API integration | Costs can escalate with usage | Great for accessing multiple APIs | | Runway ML | $12/mo, no free tier | Creative AI applications | Limited to creative tasks | We don’t use it, not our focus | | AI Dungeon | Free, subscription $9/mo | Interactive storytelling | Limited use cases | Fun for experimentation, not practical |

Step 2: Set Up Your Development Environment

  1. Install VS Code: Download and install Visual Studio Code. It’s lightweight and has great extensions.
  2. Set Up Your Project: Create a new folder for your project and open it in VS Code.
  3. Install Required Libraries: Open your terminal and run:
    pip install openai streamlit
    
    This will install the libraries needed to interact with the OpenAI API and build your app interface.

Step 3: Write Your First AI-Powered Code

Now, let’s write a simple Streamlit app that uses the OpenAI API to generate text based on user input.

  1. Create a new file called app.py in your project folder.

  2. Add the following code:

    import streamlit as st
    import openai
    
    openai.api_key = 'YOUR_OPENAI_API_KEY'
    
    st.title("AI Text Generator")
    
    user_input = st.text_input("Enter a prompt:")
    if st.button("Generate"):
        response = openai.Completion.create(
            engine="text-davinci-003",
            prompt=user_input,
            max_tokens=100
        )
        st.write(response.choices[0].text)
    
  3. Replace 'YOUR_OPENAI_API_KEY' with your actual API key.

Step 4: Run Your App

  1. In your terminal, run the following command to start your Streamlit app:
    streamlit run app.py
    
  2. Your browser should automatically open a new tab with your app running. Enter a prompt and click "Generate" to see your AI in action!

Troubleshooting: What Could Go Wrong

  • Error: API Key Not Working: Double-check that you’ve copied your API key correctly from the OpenAI dashboard.
  • Streamlit Not Installing: Make sure you have Python installed and that your terminal recognizes the pip command.
  • Unexpected Output: If the AI isn’t generating what you expect, try refining your input prompt.

What's Next: Expanding Your App

Once you've got your first app running, consider these next steps:

  • Add More Features: Incorporate a dropdown for selecting different AI models or a sidebar for user options.
  • Deploy Your App: Use platforms like Heroku or Vercel to make your app accessible online.
  • Learn More: Check out our podcast, Built This Week, for episodes on scaling AI projects and practical coding tips.

Conclusion: Start Here

If you're looking to make your first AI app in under two hours, start with Streamlit and the OpenAI API. This combination is practical, cost-effective, and gets you up and running quickly. Once you’re comfortable, explore more advanced tools and features.

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools
Ai Coding Tools

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them)

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them) In the everevolving landscape of AI coding tools, it's easy to get swept up in the hype. As indie hackers and s

Nov 30, 20263 min read
Ai Coding Tools

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026 In 2026, the landscape for indie hackers and solo founders has evolved significantly, especially with the advent

Nov 26, 20264 min read
Ai Coding Tools

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026 If you’re a developer stuck maintaining legacy code, you know the frustration. It’s like navigating a maze blindfolde

Nov 23, 20264 min read
Ai Coding Tools

10 AI Coding Tools That Will Save You Hours of Debugging in 2026

10 AI Coding Tools That Will Save You Hours of Debugging in 2026 Debugging can feel like a neverending cycle of frustration. Whether you're a solo founder or an indie hacker, spend

Nov 18, 20265 min read
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for MVP Development

10 Common Mistakes When Using AI Coding Tools for MVP Development As a founder in 2026, you’re likely aware that AI coding tools can significantly speed up the MVP development proc

Nov 16, 20264 min read
Ai Coding Tools

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026 As a beginner developer, you’ve probably come across a ton of buzz surrounding AI coding tools. But with all the hyp

Nov 12, 20263 min read