How to Run Your Bot

Follow these steps and your AI bot will be running in under 10 minutes.

What You Need

  • 1Python 3.8 or higher installed on your computer
  • 2An OpenAI API key (from platform.openai.com)
  • 3The .py file you downloaded from RoboSmith
  • 4A terminal / command prompt

Step 1

Install the OpenAI library

Run this in your terminal:

Terminal
pip install openai

If you're on Mac/Linux and pip doesn't work, try pip3 install openai.

Step 2

Add your OpenAI API key

This is the most important step. The bot needs your API key to call OpenAI.

Option A

Environment variable (recommended)

Windows (Command Prompt):

Command Prompt
setx OPENAI_API_KEY "sk-your-key-here"

After running this, close and reopen your terminal.

Mac / Linux (Terminal):

Terminal
export OPENAI_API_KEY="sk-your-key-here"
Option B

Paste directly into the file

Open the .py file in any text editor. Near the top, find the line that creates the OpenAI client and add your key:

your-bot.py
from openai import OpenAI
client = OpenAI(api_key="sk-your-key-here")

Where to get your API key:

  1. 1Go to platform.openai.com
  2. 2Click "API keys" in the left sidebar
  3. 3Click "Create new secret key"
  4. 4Copy it immediately — you won't see it again
  5. 5Note: you need OpenAI API credits (separate from a ChatGPT Plus subscription)

Step 3

Run the bot

In your terminal, navigate to where you downloaded the file:

Terminal
cd Downloads

Then run it:

Terminal
python ai-bot-builder-template.py

(Replace the filename with whichever template you downloaded.)

Type hello and press Enter. Your bot will respond.

Common errors

Click any error below to see the fix.

Need a different bot template?

Browse the full collection — customer support, sales, HR, social media, and more.

Browse Bot Templates