π¬ Open-source, self-hosted AI agent that runs a YouTube channel end to end: researches topics, writes scripts, generates narration, visuals and video, optimizes SEO, and publishes after your approval, then learns from analytics. Works with Gemini, OpenAI, OpenRouter, DeepSeek and more.
AI providers
YouTube Automation Agent runs on your own API keys. One text provider is enough to start. Narration, images, and AI video are optional layers on top. Pick providers in npm run walkthrough, or set their keys in .env (.env.example documents every setting).
Text
Pick one in the walkthrough, or set its key in .env. The SDK base URL is configured for you.
| Provider | Models | Key | Env var |
|---|---|---|---|
| Google Gemini | Gemini 3.8 Flash, Gemini 4 Argon (paid only), 3.5 Flash-Lite | AI Studio | GEMINI_API_KEY |
| OpenAI | GPT-6.1 Sol, GPT-6 Astra, GPT-6 Luna | platform.openai.com | OPENAI_API_KEY |
| OpenRouter | 400+ models through one key; curated defaults are checked against its live catalog | openrouter.ai | OPENROUTER_API_KEY |
| Kimi (Moonshot AI) | Kimi K3, K2.7 Code, K2.6 | platform.kimi.ai | MOONSHOT_API_KEY |
| MiMo (Xiaomi) | MiMo V2.6 Pro, V2.6 Flash | mimo.mi.com | MIMO_API_KEY |
| GLM (Zhipu AI) | GLM-5.3, 5.3 Flash, 5.2 | z.ai | GLM_API_KEY |
| DeepSeek | DeepSeek V4.1 Flash, V4 Pro | platform.deepseek.com | DEEPSEEK_API_KEY |
| MiniMax | MiniMax M3.1 Flash, M3 | platform.minimax.io | MINIMAX_TEXT_API_KEY |
Anthropic Claude is available through OpenRouter (anthropic/claude-fable-5.1). OpenRouter, Kimi, MiMo, GLM, DeepSeek, and MiniMax cover scripts only. Add a Gemini or OpenAI key for images and narration, or ElevenLabs for narration.
Narration and images
- Narration uses the first configured provider in this order: ElevenLabs (Eleven v3, needs
ELEVENLABS_API_KEYandELEVENLABS_VOICE_ID), OpenAI (gpt-4o-mini-tts), then Gemini (gemini-3.8-flash-tts). A video without working narration can't be approved. - Images use OpenAI (GPT Image 2) and Gemini (
gemini-3.1-flash-image, which needs billing enabled), each falling back to the other. With neither, slides use gradient backgrounds and thumbnails come from the built-in designer.
Video
Local slideshow rendering is the default, so you never pay for video unless you choose a provider in Channel setup and set a paid-seconds cap. If a provider fails, the video falls back to the local slideshow.
| Provider | Default model | Best fit | Clip limits | Env var |
|---|---|---|---|---|
| ByteDance | bytedance/seedance-2.5 through Replicate |
Cinematic long scenes and large reference sets | 4β30 seconds | REPLICATE_API_TOKEN |
| MiniMax | MiniMax-H3 |
Multimodal references, native stereo audio, optional 2K | 4β15 seconds | MINIMAX_API_KEY |
gemini-omni-1.1-flash |
Fast generation and conversational editing | 3β10 seconds | GEMINI_API_KEY |
|
| Kuaishou | kling-v3-omni |
Storyboards and character/voice consistency | 3β15 seconds | KLING_ACCESS_KEY, KLING_SECRET_KEY |
| Alibaba | Wan 2.7 task-specific models | Efficient generation, reference video, and continuation | 2β15 seconds | DASHSCOPE_API_KEY |
Long videos use hybrid assembly: generated clips for the hook and key sections, with the rest of the timeline filled locally. See AI video generation.
Environment variables
npm run walkthrough writes your configuration for you. To edit it by hand, copy .env.example to .env. The essentials:
# One text provider (see the table above)
GEMINI_API_KEY=...
# Optional: narration, images, and AI video
# ELEVENLABS_API_KEY=...
# ELEVENLABS_VOICE_ID=...
# OPENAI_API_KEY=sk-...
# VIDEO_PROVIDER=slideshow # auto, seedance, minimax_h3, google_omni, kling, wan
# VIDEO_MAX_GENERATED_SECONDS=60
# App
PORT=3456
# HOST=127.0.0.1 # default: this machine only
# API_KEY=some-long-random-string
CHANNEL_NAME=Your Channel Name
DEFAULT_PRIVACY_STATUS=private
The dashboard listens on 127.0.0.1 by default. If you set HOST=0.0.0.0 to reach it from other devices, also set API_KEY, which every request that changes something must then send in the x-api-key header.
Adding a provider
See Extending in the contributing guide for how to add a text or video provider.
Acknowledgments
- Google: Gemini 3.8 Flash, Gemini 4 Argon, Gemini 3.1 Flash Image, Gemini 3.8 Flash TTS, Gemini Omni Flash, and the YouTube Data and Analytics APIs
- OpenAI: GPT-6.1 Sol, GPT Image 2, gpt-4o-mini-tts
- OpenRouter: unified multi-model API
- Moonshot AI: Kimi K3
- Xiaomi: MiMo V2.6 Pro
- Zhipu AI: GLM-5.3
- DeepSeek: DeepSeek V4.1 Flash
- MiniMax: MiniMax M3 text and H3 video
- ElevenLabs: Eleven v3 TTS
- Replicate: Seedance 2.5 and Wan 2.7 hosting
- Kuaishou Kling: Kling 3.0 Omni
- Alibaba Cloud Model Studio: Wan 2.7