# How to Configure RedditVideoMakerBot API Keys: Complete Setup Guide

> Configure RedditVideoMakerBot API keys with this essential setup guide. Learn how to edit your config.toml file and ensure your bot runs smoothly.

- Repository: [Lewis Menelaws/RedditVideoMakerBot](https://github.com/elebumm/RedditVideoMakerBot)
- Tags: how-to-guide
- Published: 2026-04-08

---

**RedditVideoMakerBot reads all API credentials from a TOML configuration file ([`config.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/.config.template.toml) that defines all required keys. When you first run the application, [`main.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/main.py) invokes `settings.check_toml()` to copy this template into a user-specific [`config.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml) file and validate each entry.

In [`main.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/main.py) lines 93-95, the startup sequence loads the configuration:

```python
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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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 `true` if you use two-factor authentication

These values are consumed in [`reddit/subreddit.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/reddit/subreddit.py) lines 36-43 when the Reddit client is instantiated:

```python
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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml).

### ElevenLabs Configuration

To use **ElevenLabs** voices, provide the `elevenlabs_api_key` value. The [`TTS/elevenlabs.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/TTS/elevenlabs.py) module reads this key during initialization (lines 26-33):

```python
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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/TTS/openai_tts.py) lines 22-27 validates this key:

```python
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

1. **Copy the template** on first run:

   ```bash
   cp utils/.config.template.toml config.toml
   ```

2. **Edit [`config.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml)** with your preferred text editor, replacing placeholder values:

   ```toml
   [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"
   ```

3. **Run the bot**. If required fields are empty or malformed, the `settings.check_toml` function will prompt you interactively for the missing values.

4. **Security note**: Never commit [`config.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml) to a public repository. The project's `.gitignore` already excludes this file.

## How API Keys Flow Through the Application

The configuration pipeline follows this strict sequence:

1. **Startup**: [`main.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/main.py) calls `settings.check_toml` to load the user file into `settings.config`
2. **Reddit module**: Pulls credentials from `settings.config` to create the `praw.Reddit` client in [`reddit/subreddit.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/reddit/subreddit.py)
3. **TTS modules**: Each engine ([`TTS/elevenlabs.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/TTS/elevenlabs.py), [`TTS/openai_tts.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/TTS/openai_tts.py)) reads its respective key when `run()` or `initialize()` is invoked
4. **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:

```python
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:

```python
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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml)
- The entry point in [`main.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/main.py) validates configuration against [`utils/.config.template.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/.config.template.toml) using `settings.check_toml()`
- Reddit authentication requires five credential fields consumed by [`reddit/subreddit.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml) prevents interactive interruptions

## Frequently Asked Questions

### Where does RedditVideoMakerBot store API keys?

RedditVideoMakerBot stores API keys in a TOML file named [`config.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml) in the project root. This file is generated from the template at [`utils/.config.template.toml`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml). The ElevenLabs engine in [`TTS/elevenlabs.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/TTS/elevenlabs.py) and the OpenAI engine in [`TTS/openai_tts.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/utils/settings.py) validates every required key when [`main.py`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/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`](https://github.com/elebumm/RedditVideoMakerBot/blob/main/config.toml) eliminates these interactive prompts.