Bring Your Own API Key Video Generator
Most AI video tools charge you a subscription, then charge you again per render on top of that. BYOK flips the model. You bring your own API key from Anthropic, OpenAI, Google, or OpenRouter, your browser calls the provider directly, and you pay the raw model price with no middleman markup. Gemini and OpenRouter even offer free tiers — no credit card required. Here's how it works in Phantomline, what it costs, and when it makes sense compared to running models locally.
What BYOK means for video creators
BYOK stands for Bring Your Own Key. The idea is simple: instead of the video tool proxying your AI requests through its own servers (and marking up the cost), you paste your API key from a provider like Anthropic, OpenAI, Google, or OpenRouter directly into the app. When you hit Generate, your browser sends the request straight to the AI provider over HTTPS. The response comes back to your browser. Phantomline's server is never in the loop for inference.
This matters because it removes the economic layer that most SaaS video tools depend on. Tools like InVideo, Pictory, and Submagic bundle AI costs into their subscription or per-render fees. You pay their price, not the model's price. With BYOK, you pay exactly what the model provider charges — or nothing at all. Gemini and OpenRouter both offer free tiers that require no credit card. Claude Haiku runs roughly $0.003 per short script, Claude Sonnet about $0.005, GPT-4o a similar range. No subscription surcharge on top.
The second thing BYOK changes is the relationship. Your API key, your account, your usage dashboard, your rate limits. If you want to switch from Claude to Gemini tomorrow, you change one setting. If Phantomline disappeared, your API key still works with any other tool that supports that provider. You own the relationship with the AI, not the video tool.
Why BYOK matters: cost, control, and transparency
You pick the model
Cloud video tools choose the model for you. Usually it's whatever's cheapest for them to run, not whatever's best for your content. With BYOK in Phantomline, you pick from the full model lineup:
- Claude Haiku: fastest and cheapest. Good for bulk drafts, listicle scripts, and anything where speed matters more than nuance.
- Claude Sonnet: the balanced pick. Writes strong hooks, handles retention beats well, produces scripts that need minimal editing. This is where most BYOK users land.
- Claude Opus: maximum depth. Best for long-form research scripts, true-crime narratives, and content where the writing quality is the product.
- GPT-4o: OpenAI's flagship. Comparable to Sonnet in quality, different in style. Some creators prefer its tone for certain niches.
- GPT-4o mini: OpenAI's budget option. Fast, cheap, good enough for high-volume formats.
- Gemini 2.0 Flash: Google's fast model with a generous free tier. No credit card required to start. Good quality for most script formats.
- Gemini 2.5 Pro: Google's frontier model. Strong reasoning and structured output. Free tier available with rate limits.
- OpenRouter: a unified gateway to hundreds of models, including free ones. Pick the model that fits your niche, or try several without separate accounts for each provider.
You can switch models between scripts. Draft with Haiku, polish with Sonnet. Use Opus for your tentpole video and Haiku for the filler. No tool locks you into one tier.
You control the cost
A 1,500-word faceless YouTube script uses roughly 2,000 tokens of output and 500 tokens of input (the system prompt plus your topic). At Anthropic's published rates, that's about $0.005 with Sonnet. Generate 30 scripts a month and you're at $0.15/month in AI costs. Not $15. Not $29. Fifteen cents.
Compare that to a cloud video SaaS where the AI cost is bundled into a $25-$50/month subscription. You're paying the subscription whether you use 5 scripts or 50. With BYOK, you pay for exactly what you use.
You own the provider relationship
Your Anthropic, OpenAI, Google, or OpenRouter account is yours. You see your usage in their dashboard. You set your own spend limits. You get their uptime SLA, not a reseller's. If you build other tools that use the same API key, the usage is consolidated in one place. BYOK treats AI like a utility: you pick the provider, you pay the meter, and the video tool is just the interface.
The security model: zero custody
The most common objection to pasting an API key into a web app is security. Here's exactly how Phantomline handles it:
- localStorage only. Your API key is saved in your browser's localStorage under a namespaced key. It never leaves the browser's storage.
- Direct HTTPS calls. When you generate a script, your browser makes a fetch request directly to the provider's API (Anthropic, OpenAI, Google, or OpenRouter). The request goes from your browser to the provider. Phantomline's server is not a proxy, not a relay, not a man-in-the-middle.
- Zero custody. Phantomline never receives, stores, logs, or transmits your API key. There is no server-side code that handles cloud API keys. The entire BYOK flow runs in the browser engine adapter (
CloudKeyEngineinengines.js). - You can verify this. Open your browser's Network tab while generating a script. You'll see one request to the AI provider's domain and zero requests carrying your key to Phantomline's server.
This is a meaningfully different architecture from tools that ask for your key and then proxy requests through their backend. Proxied keys pass through the vendor's servers, which means the vendor can log them, store them, or leak them in a breach. Phantomline's browser-direct approach eliminates that entire attack surface.
Supported providers
Anthropic (Claude)
Phantomline supports the full Claude model family through the Anthropic Messages API. You create an API key at console.anthropic.com, paste it into Phantomline's Settings, and choose Haiku, Sonnet, or Opus. The browser calls the Anthropic API directly with CORS-safe headers. Claude excels at structured script output: it follows the hook/body/retention-beat/CTA format reliably and writes in a natural, non-robotic tone that works well for narration.
OpenAI (GPT)
Phantomline also supports OpenAI's Chat Completions API. You create an API key at platform.openai.com, paste it in, and choose GPT-4o or GPT-4o mini. The browser calls OpenAI's API directly. GPT-4o produces slightly different script styles than Claude. Some creators prefer its pacing for listicle and explainer formats. GPT-4o mini is a good budget alternative when you want fast turnaround and the script topic is straightforward.
Google (Gemini) — free tier available
Phantomline supports the Gemini API through Google AI Studio. You create an API key at aistudio.google.com/apikey — no credit card required. The free tier gives you generous rate limits for Gemini 2.0 Flash and Gemini 2.5 Pro. Your browser calls the Gemini API directly. Gemini Flash is fast and produces solid scripts across most niches. Gemini Pro offers frontier-level quality comparable to Claude Sonnet. For creators who want to try BYOK at zero cost, Gemini is the easiest on-ramp.
OpenRouter — free tier available
OpenRouter is a unified API gateway that gives you access to hundreds of models from multiple providers through a single API key. Create a key at openrouter.ai/keys — many models are available for free with no credit card. Phantomline sends requests directly to the OpenRouter API from your browser. OpenRouter is ideal if you want to experiment with different models (Llama, Mistral, Gemma, and more) without creating separate accounts with each provider.
Cost comparison: BYOK vs cloud SaaS vs local
The real question is how BYOK stacks up against the alternatives. Here's a concrete comparison for a creator publishing 30 videos a month:
| Approach | Script cost per video | Monthly cost (30 videos) | Annual cost |
|---|---|---|---|
| BYOK (Claude Sonnet) | ~$0.005 | ~$0.15 | ~$1.80 |
| BYOK (Claude Haiku) | ~$0.003 | ~$0.09 | ~$1.08 |
| BYOK (GPT-4o) | ~$0.006 | ~$0.18 | ~$2.16 |
| BYOK (Gemini Flash — free tier) | $0 | $0 | $0 |
| BYOK (OpenRouter — free models) | $0 | $0 | $0 |
| InVideo AI (Pro plan) | ~$0.50+ bundled | $25/mo subscription | $300 |
| Pictory (Premium) | ~$0.55 bundled | $33/mo subscription | $396 |
| Local Ollama (Llama 3.1 8B) | $0 | $0 | $0 |
| WebGPU (Llama 3.2 1B in browser) | $0 | $0 | $0 |
BYOK with Gemini or OpenRouter free tiers gives you cloud-quality scripts at literally zero cost — matching local Ollama on price while delivering better script quality. Claude and GPT cost pennies per script, which rounds to free at normal volumes. Either way, the gap between BYOK and a cloud video subscription is $25-$50/month, or $300-$600/year.
The cloud SaaS column is where things get expensive. You're paying for convenience, for not having to manage an API key, and for the vendor's GPU margin. At 30 videos a month, the gap between BYOK and a cloud subscription is $25-$33/month, or $300-$400/year. That's money that could go toward better thumbnails, stock footage, or just staying in your pocket.
How it works: paste key, pick model, generate, render
The setup takes about two minutes:
- Open Phantomline and go to Settings. Under AI engine, select Cloud.
- Paste your API key. Grab your key from your provider: Anthropic at
console.anthropic.com/settings/keys, OpenAI atplatform.openai.com/api-keys, Google ataistudio.google.com/apikey(free, no credit card), or OpenRouter atopenrouter.ai/keys(free models available). Paste it into the key field. Phantomline saves it to localStorage. - Pick a model. The dropdown shows the available models for your provider. Choose based on your quality/cost/speed preference.
- Generate. Type your topic, hit Generate, and watch the script come back in 2-5 seconds. Your browser sent the request directly to the provider and got the response back without any server round-trip through Phantomline.
- Render. Once the script is ready, render narration with Kokoro TTS (local) or Web Speech API, add music, and assemble the final MP4. The BYOK path only handles script generation. Everything else in the pipeline runs the same way it does with any other engine.
When to use BYOK vs local Ollama vs WebGPU
Phantomline gives you three script-generation engines. Each has a clear use case:
Use BYOK when:
- You want the best possible script quality. Claude Sonnet and GPT-4o write noticeably better hooks, transitions, and retention beats than Llama 3.1 8B.
- You want fast generation. BYOK returns scripts in 2-5 seconds. Local Ollama takes 30-60 seconds on typical hardware.
- Your hardware can't run Ollama comfortably. If you have less than 16 GB of RAM or an older GPU, BYOK offloads the inference to the cloud while keeping everything else local.
- You're producing content where the writing quality is the product, like long-form narrative channels or research-heavy scripts.
Use local Ollama when:
- You want $0 per script, period. No API costs at all.
- You need full offline capability. Ollama runs without any internet connection after the initial model download.
- Privacy is a hard requirement. Nothing leaves your machine. No API calls, no provider logging, no network traffic.
- You have a capable GPU and don't mind the slower generation time.
Use WebGPU (browser) when:
- You're on a phone or Chromebook and can't install Ollama.
- You want zero setup. WebGPU runs Llama 3.2 1B directly in your browser after a one-time model download.
- Script quality is secondary to convenience. The 1B model is smaller and less capable than Ollama's 8B, but it works anywhere WebGPU is supported.
Most serious creators land on BYOK as their primary engine — Claude Sonnet for maximum quality, or Gemini Flash for a free starting point — and keep Ollama as a fallback for offline work. With free tiers from Gemini and OpenRouter, the cost difference between BYOK and local can be literally zero. The quality difference is noticeable.
What BYOK does not cover
BYOK in Phantomline handles script generation only. The rest of the video pipeline uses different engines that don't require an API key:
- Narration: Kokoro TTS on desktop (fully local, 16 voices) or Web Speech API in the browser. No cloud API needed.
- Music: MusicGen on desktop or bundled royalty-free tracks in the browser. No cloud API needed.
- Video assembly: ffmpeg on desktop, ffmpeg.wasm in the browser. Fully local.
- YouTube publishing: Uses YouTube's Data API through Phantomline's OAuth flow. Separate from the BYOK key.
This design is intentional. Script generation is the one step where cloud models provide a clear quality advantage over local models. The other steps (TTS, music, video assembly) are handled well by local tools, so there's no reason to add cloud dependency there.
FAQ
What does BYOK mean in a video generator?
BYOK stands for Bring Your Own Key. Instead of the video tool charging you a markup on AI usage, you paste your own API key from Anthropic, OpenAI, Google, or OpenRouter. Your browser calls the provider directly at their published rates. Gemini and OpenRouter offer free tiers with no credit card required.
Is my API key safe in Phantomline?
Yes. Your key is stored in your browser's localStorage and never sent to Phantomline's server. When you generate a script, your browser makes an HTTPS request directly to the AI provider (Anthropic, OpenAI, Google, or OpenRouter). Phantomline has zero custody of your key.
How much does BYOK script generation cost?
Gemini and OpenRouter offer free tiers with no credit card required — you can generate scripts at zero cost. Claude Haiku runs roughly $0.003 per short script, Sonnet about $0.005, GPT-4o comparable to Sonnet. These are raw provider prices with no Phantomline markup.
Which AI models can I use with BYOK?
Phantomline supports Anthropic Claude (Haiku, Sonnet, Opus), OpenAI (GPT-4o, GPT-4o mini), Google Gemini (Flash, Pro), and OpenRouter (access to hundreds of models including free ones). You choose the provider and model in Settings and can switch between scripts.
When should I use BYOK instead of local Ollama?
Use BYOK when you want frontier-quality scripts, fast 2-5 second generation, or your hardware can't run Ollama comfortably. Use Ollama when you want $0 per script, full offline capability, or maximum privacy. Most creators use BYOK as their primary engine and keep Ollama as a fallback.
Try it
Free tier needs no card. Open the studio See pricing