Guides

Bring your own key

Connect an API key from OpenRouter, Anthropic, OpenAI or Google Gemini, and your videos run on your account with that provider. It works on every plan, including Free.

Why use your own key

  • Every model, any plan. Your key unlocks models above your plan, plus models that only run on your own key (see Models).
  • Your provider, your terms. Use your own credits, spending limits, data agreements and rate limits.
  • Nothing to change in code. Save a key once and every request, from the website, the API or the SDKs, uses it automatically.

Supported providers

ProviderRunsDefault model

OpenRouter

Key: sk-or-v1-…

Get a key ↗

Every model, including any model id on OpenRouterClaude Sonnet 5.5

Anthropic

Key: sk-ant-api03-…

Get a key ↗

Claude modelsClaude Sonnet 5.5

OpenAI

Key: sk-proj-…

Get a key ↗

GPT modelsGPT-6.1 Sol

Google Gemini

Key: AIza…

Get a key ↗

Gemini modelsGemini 3.1 Pro

“Default model” is what runs when you don’t pass model and that key is the one in use.

Save a key (recommended)

  • Open Settings → AI providers.
  • Pick the provider, paste your key and save. We send a small test request to the provider first, so a mistyped key is caught right away.
  • That’s it. The model picker on the website marks the models your key runs, and API requests use the key without any extra fields.

You can keep one key per provider. Replace a key by saving a new one, use the refresh button to re-check it, or remove it at any time. Changes apply to the next video you start.

Send a key per request

For one-off jobs, or if you’d rather not store a key with us, send it in the llm field. It’s checked with the provider, used for that one video, and never saved.

FieldTypeNotes
llm.providerstringopenrouter, anthropic, openai or gemini
llm.api_keystringYour key for that provider
byok.sh
curl -sS -X POST "$MANIMOTION_API/video/request" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $MANIMOTION_KEY" \
  -d '{
    "prompt": "Explain eigenvectors visually",
    "model": "anthropic/claude-opus-5.5",
    "llm": {
      "provider": "anthropic",
      "api_key": "'"$ANTHROPIC_API_KEY"'"
    }
  }'
RESPONSEresponse.json
{
  "job_id": "f0e1d2c3-b4a5-6789-0abc-def123456789",
  "status": "queued",
  "model": "anthropic/claude-opus-5.5",
  "key_source": "byok",
  …
}

With the SDKs

byok.mjs
const video = await manimotion.videos.generate({
  prompt: "Explain eigenvectors visually",
  model: "anthropic/claude-opus-5.5",
  llm: { provider: "anthropic", apiKey: process.env.ANTHROPIC_API_KEY },
});

console.log(video.keySource); // "byok"

Which key runs a video

For each request, the first match wins:

  1. The key in the request’s llm field.
  2. Your saved key from the model’s own maker (for example, your Anthropic key for a Claude model).
  3. Your saved OpenRouter key.
  4. Our key, if your plan includes the model.

The response’s key_source tells you which one ran: "byok" for your key, "platform" for ours. Once a video starts on your key, every AI step of that video uses your key.

Billing and limits

  • Your provider bills you directly for the tokens your videos use. We add nothing on top.
  • Videos still count toward your plan’s video limit, because rendering and storage happen on our side. See Pricing.
  • A video that runs on your key never touches our AI credits, even when it fails.

When a key fails

Problems are reported as early as possible, with a message that names the provider and says what to fix.

WhenWhat you see
The key in llm is wrongThe request is rejected with 400. No job is created and nothing counts toward your limit.
The key can’t run the model400, telling you which provider’s key the model needs.
The provider rejects the key mid-videoThe job fails with error_code: "llm_auth". A saved key is flagged in Settings → AI providers.
Your provider account is out of creditsllm_quota. Top up with your provider and retry.
Your provider is rate-limiting youllm_rate_limit. Wait a minute and retry.
The provider doesn’t know the model idllm_model. Check the id, or pick another model.

Every code is listed on the Errors page.

Security

  • Saved keys are encrypted (AES-256-GCM) before they’re stored, and only decrypted at the moment a video needs them.
  • After saving, you only ever see a masked version like sk-ant-…x9Qa. No page or API returns the full key.
  • Keys sent in llm are used for that one video and never stored.
  • Error messages are scrubbed so a key is never echoed back.
  • Use a dedicated key with a spending limit, so you can revoke it with your provider at any time.