Authentication
Learn how to authenticate with the VEO3 API using API keys. All API endpoints require authentication for secure access.
X-API-Key header for every request.API Key Authentication
VEO3 uses API keys for authentication. Each request must include your API key in the request header.
X-API-Key: veo3_your_api_key_herecurl -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"}'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
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.
Look for the 'API Keys' or 'Developer' section in your dashboard navigation. This is typically found in the settings or account area.
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.
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
X-API-Key: veo3_your_api_key_herecurl -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"}'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'
})
});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
// .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'
};# .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
Authentication Errors
Common authentication errors and how to resolve them
{
"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
{
"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