API Authentication

Learn how to create and manage API keys for programmatic access to SeedDance.

Getting Started

1. Create an API Key

Go to Account → API Keys and click "Create API Key". Give it a descriptive name (e.g., "Production", "Development").

2. Copy Your Key

Your full API key is shown only once after creation. Copy it immediately and store it securely. The key format is: sk-sd_xxxxxxxxxxxxxxxx

3. Use in API Requests

Include your key in the Authorization header of every request:

Authorization: Bearer sk-sd_your_api_key_here

Security Best Practices

  • Never expose API keys in client-side code, public repositories, or frontend applications
  • Use environment variables to store API keys in your server-side code
  • Create separate keys for development and production environments
  • Revoke keys immediately if they are compromised
  • Each API key inherits the credits and subscription of your account

Limits

Max keys per account5
Rate limit (default)60 requests / minute
Key formatsk-sd_ + 40 characters

Quick Start Example

import os
import requests

api_key = os.environ["SEEDANCE_API_KEY"]
headers = {"Authorization": f"Bearer {api_key}"}

# Check credits
resp = requests.get("https://happy-horse.ai/api/v1/credits", headers=headers)
data = resp.json()["data"]
print(f"Credits: {data['credits']}")

# Generate a video
resp = requests.post(
    "https://happy-horse.ai/api/v1/generate",
    headers=headers,
    json={"prompt": "A serene mountain lake at dawn", "duration": 5},
)
print(f"Video ID: {resp.json()['data']['video_id']}")