How to Configure RedditVideoMakerBot API Keys: Complete Setup Guide
RedditVideoMakerBot reads all API credentials from a TOML configuration file (config.toml) that is validated at startup and loaded into a global settings.config dictionary.
The open-source RedditVideoMakerBot requires API keys for both Reddit access and text-to-speech services to automatically generate videos from subreddit threads. According to the elebumm/RedditVideoMakerBot source code, the bot uses a template-based configuration system that prompts for missing values during initialization.
Where RedditVideoMakerBot Stores API Keys
The bot maintains a default template at utils/.config.template.toml that defines all required keys. When you first run the application, main.py invokes settings.check_toml() to copy this template into a user-specific config.toml file and validate each entry.
In main.py lines 93-95, the startup sequence loads the configuration:
directory = Path().absolute()
config = settings.check_toml(
f"{directory}/utils/.config.template.toml", f"{directory}/config.toml"
)
The heavy lifting occurs in utils/settings.py, where the check_toml function parses the template with the toml library, walks every key, and writes the final user-filled data back to config.toml. The resulting dictionary is stored in the module-level variable settings.config and imported by every other component.
Required Reddit API Credentials
RedditVideoMakerBot authenticates with Reddit using the PRAW library. You must provide the following five values under the [reddit.creds] section:
- client_id – Your Reddit script app ID
- client_secret – Your Reddit script app secret
- username – Your Reddit username
- password – Your Reddit password (or password plus 2FA code)
- 2fa – Boolean flag, set to
trueif you use two-factor authentication
These values are consumed in reddit/subreddit.py lines 36-43 when the Reddit client is instantiated:
reddit = praw.Reddit(
client_id=settings.config["reddit"]["creds"]["client_id"],
client_secret=settings.config["reddit"]["creds"]["client_secret"],
user_agent="Accessing Reddit threads",
username=username,
passkey=passkey,
check_for_async=False,
)
Required Text-to-Speech API Keys
Depending on your chosen TTS (text-to-speech) provider, you must supply additional API keys in the [settings.tts] section of config.toml.
ElevenLabs Configuration
To use ElevenLabs voices, provide the elevenlabs_api_key value. The TTS/elevenlabs.py module reads this key during initialization (lines 26-33):
if settings.config["settings"]["tts"]["elevenlabs_api_key"]:
api_key = settings.config["settings"]["tts"]["elevenlabs_api_key"]
else:
raise ValueError("You didn't set an Elevenlabs API key! …")
self.client = ElevenLabs(api_key=api_key)
OpenAI Configuration
For OpenAI TTS services, set the openai_api_key field. The constructor in TTS/openai_tts.py lines 22-27 validates this key:
self.api_key = settings.config["settings"]["tts"].get("openai_api_key")
if not self.api_key:
raise ValueError("No OpenAI API key provided …")
TikTok Session ID
When using TikTok TTS, the bot requires a tiktok_sessionid cookie value rather than a traditional API key. This is defined in the template at line 55.
Step-by-Step Configuration Process
-
Copy the template on first run:
cp utils/.config.template.toml config.toml -
Edit
config.tomlwith your preferred text editor, replacing placeholder values:[reddit.creds] client_id = "YOUR_REDDIT_CLIENT_ID" client_secret = "YOUR_REDDIT_CLIENT_SECRET" username = "YOUR_REDDIT_USERNAME" password = "YOUR_REDDIT_PASSWORD" 2fa = false [settings.tts] voice_choice = "elevenlabs" elevenlabs_api_key = "YOUR_ELEVENLABS_KEY" openai_api_key = "YOUR_OPENAI_KEY" tiktok_sessionid = "YOUR_TIKTOK_SESSION_ID" -
Run the bot. If required fields are empty or malformed, the
settings.check_tomlfunction will prompt you interactively for the missing values. -
Security note: Never commit
config.tomlto a public repository. The project's.gitignorealready excludes this file.
How API Keys Flow Through the Application
The configuration pipeline follows this strict sequence:
- Startup:
main.pycallssettings.check_tomlto load the user file intosettings.config - Reddit module: Pulls credentials from
settings.configto create thepraw.Redditclient inreddit/subreddit.py - TTS modules: Each engine (
TTS/elevenlabs.py,TTS/openai_tts.py) reads its respective key whenrun()orinitialize()is invoked - Video creation: The pipeline uses the authenticated Reddit client and generated audio without accessing keys directly
Debugging and Verification Snippets
Use this minimal snippet to verify that your keys loaded correctly:
from utils import settings
settings.check_toml(
"utils/.config.template.toml", "config.toml"
)
print("Reddit client ID:", settings.config["reddit"]["creds"]["client_id"])
print("ElevenLabs API key:", settings.config["settings"]["tts"]["elevenlabs_api_key"])
print("OpenAI API key:", settings.config["settings"]["tts"]["openai_api_key"])
To verify Reddit authentication specifically:
from reddit.subreddit import get_subreddit_threads
thread = get_subreddit_threads(None)
print("Fetched thread title:", thread["thread_title"])
Summary
- RedditVideoMakerBot uses a TOML-based configuration system centered on
config.toml - The entry point in
main.pyvalidates configuration againstutils/.config.template.tomlusingsettings.check_toml() - Reddit authentication requires five credential fields consumed by
reddit/subreddit.py - TTS services require service-specific keys (ElevenLabs, OpenAI, or TikTok session ID) read by their respective modules in
TTS/ - Runtime validation prompts for missing keys, but pre-populating
config.tomlprevents interactive interruptions
Frequently Asked Questions
Where does RedditVideoMakerBot store API keys?
RedditVideoMakerBot stores API keys in a TOML file named config.toml in the project root. This file is generated from the template at utils/.config.template.toml when the bot first starts, and its contents are loaded into the global settings.config dictionary for use across all modules.
What Reddit API credentials are required for RedditVideoMakerBot?
You must supply client_id, client_secret, username, password, and a boolean 2fa flag in the [reddit.creds] section. These credentials are used by reddit/subreddit.py to instantiate a PRAW Reddit client that fetches subreddit threads.
How do I add ElevenLabs or OpenAI API keys to RedditVideoMakerBot?
Add the elevenlabs_api_key or openai_api_key values to the [settings.tts] section of config.toml. The ElevenLabs engine in TTS/elevenlabs.py and the OpenAI engine in TTS/openai_tts.py automatically read these values from settings.config during initialization.
Why does RedditVideoMakerBot prompt me for API keys at runtime?
The settings.check_toml() function in utils/settings.py validates every required key when main.py starts. If any required field is missing or malformed, the bot prompts you interactively to prevent startup failures. Pre-configuring all values in config.toml eliminates these interactive prompts.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →