Authentication

Learn how to authenticate with the VEO3 API using API keys. All API endpoints require authentication for secure access.

API KeysSecurityRequired

API Key Authentication

VEO3 uses API keys for authentication. Each request must include your API key in the request header.

Authentication Header
Include your API key in the X-API-Key header for every request
X-API-Key: veo3_your_api_key_here
Valid Request
curl -X POST "https://api.veo3gen.co/api/veo/text-to-video" \ -H "Content-Type: application/json" \ -H "X-API-Key: veo3_valid_key_here" \ -d '{"prompt": "A peaceful sunset"}'
Invalid Request
curl -X POST "https://api.veo3gen.co/api/veo/text-to-video" \ -H "Content-Type: application/json" \ -d '{"prompt": "A peaceful sunset"}'

Error: Missing X-API-Key header

Getting an API Key

Follow these steps to obtain your VEO3 API key from the dashboard

1
Login to Dashboard
Access your VEO3 account dashboard

Navigate to the VEO3 dashboard and sign in with your credentials. If you don't have an account, you'll need to create one first.

2
Navigate to API Keys
Find the API Keys section in your dashboard

Look for the 'API Keys' or 'Developer' section in your dashboard navigation. This is typically found in the settings or account area.

3
Create New API Key
Generate a new API key for your application

Click 'Create New Key' and provide a descriptive name for your API key. This helps you identify which application or environment the key is for.

4
Copy and Secure
Copy your API key and store it securely

Copy the generated API key immediately and store it in a secure location. You won't be able to see the full key again after this step.

Usage Examples

Examples of how to use your API key in different programming languages and tools

Standard Authentication
Basic API key authentication header
X-API-Key: veo3_your_api_key_here
cURL Example
Using API key in cURL request
curl -X POST "https://api.your-domain.com/api/veo/text-to-video" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: veo3_your_api_key_here" \
  -d '{"prompt": "A peaceful sunset"}'
JavaScript/Node.js
Using API key in JavaScript
const headers = {
  'X-API-Key': 'veo3_your_api_key_here',
  'Content-Type': 'application/json'
};

const response = await fetch('https://api.your-domain.com/api/veo/text-to-video', {
  method: 'POST',
  headers: headers,
  body: JSON.stringify({
    prompt: 'A peaceful sunset'
  })
});
Python
Using API key in Python
import requests

headers = {
    'X-API-Key': 'veo3_your_api_key_here',
    'Content-Type': 'application/json'
}

response = requests.post(
    'https://api.your-domain.com/api/veo/text-to-video',
    headers=headers,
    json={'prompt': 'A peaceful sunset'}
)

Environment Variables

Best practice: Store your API keys in environment variables instead of hardcoding them

Node.js
Environment variable setup for Node.js applications
// .env file
VEO3_API_KEY=veo3_your_api_key_here

// In your application
const apiKey = process.env.VEO3_API_KEY;

const headers = {
  'X-API-Key': apiKey,
  'Content-Type': 'application/json'
};
Python
Environment variable setup for Python applications
# .env file
VEO3_API_KEY=veo3_your_api_key_here

# In your application
import os
from dotenv import load_dotenv

load_dotenv()
api_key = os.getenv('VEO3_API_KEY')

headers = {
    'X-API-Key': api_key,
    'Content-Type': 'application/json'
}

Security Best Practices

Essential security guidelines to protect your API keys and ensure secure integration

Never expose API keys in client-side code
API keys should only be used in server-side applications or secure environments
Use environment variables
Store API keys in environment variables, not in your source code
Rotate keys regularly
Change your API keys periodically to maintain security
Use different keys for environments
Separate API keys for development, staging, and production
Monitor API key usage
Track your API key usage and set up alerts for unusual activity
Implement proper access controls
Limit who has access to your API keys within your organization

Authentication Errors

Common authentication errors and how to resolve them

401Missing API Key
{ "success": false, "error": "UNAUTHORIZED", "message": "API key missing or invalid" }

Cause: No X-API-Key header provided

Solution: Include your API key in the X-API-Key header

401Invalid API Key
{ "success": false, "error": "UNAUTHORIZED", "message": "Invalid API key" }

Cause: API key is malformed or doesn't exist

Solution: Verify your API key is correct and active

Next Steps

Now that you have authentication set up, explore other parts of the API