Authentication

Every request to the VideoGenAPI REST API is authenticated with your API key, sent as a Bearer token in the Authorization header. There is no OAuth flow or request signing for the REST API: one header is enough.

Authorization: Bearer YOUR_API_KEY
Base URL: https://videogenapi.com/api/v1/

Getting your API key

  1. Create an account and choose a plan (from $29/month). API access is enabled as soon as the plan is active.
  2. Open the dashboard and go to API keys.
  3. Click Reveal, then Copy. Store the key in an environment variable or a secrets manager.

Examples

cURL

export VIDEOGEN_API_KEY="your_key_here"

curl -X POST "https://videogenapi.com/api/v1/generate" \
  -H "Authorization: Bearer $VIDEOGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "seedance-2", "prompt": "A paper boat drifting down a rainy street", "duration": 5}'

Python

import os, requests

session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['VIDEOGEN_API_KEY']}"

r = session.post("https://videogenapi.com/api/v1/generate",
                 json={"model": "seedance-2", "prompt": "A paper boat drifting down a rainy street"})
print(r.json()["generation_id"])

Node.js

const res = await fetch("https://videogenapi.com/api/v1/generate", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.VIDEOGEN_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ model: "seedance-2", prompt: "A paper boat drifting down a rainy street" }),
});
const { generation_id } = await res.json();

Authentication errors

HTTPerrorFix
401Missing or invalid Authorization headerSend Authorization: Bearer <key>, with a space after Bearer.
401Invalid API keyThe key was mistyped, regenerated or rotated. Copy the current key from the dashboard.
403Access denied to this model. Please upgrade your plan.The key is valid but the model is not in your plan.

Rotating your key

If a key leaks, regenerate it from the dashboard: the old key stops working immediately. You can also rotate programmatically, for example from a scheduled job:

curl -X POST "https://videogenapi.com/api/v1/rotate-key" \
  -H "Authorization: Bearer YOUR_CURRENT_API_KEY"

The response contains the new key. Update your secrets before the next request, since the previous key is invalidated at once.

Keeping your key safe

  • Server-side only. Never ship the key in a browser bundle or mobile app; call the API from your backend, a worker or a serverless function.
  • Environment variables. Keep it out of source control; add .env to .gitignore.
  • One key per account. Usage, rate limits and plan allowance are tracked per key, so share it across services through your secrets manager rather than in code.
  • AI agents use separate tokens. Claude, ChatGPT and Cursor connect through the MCP server with OAuth or a personal MCP token, so you do not have to paste your REST key into an agent.

Related

Reviewed by Enzo Lanne · Founder, VideoGenAPI ·