API Documentation
Integrate AI-powered video generation into your applications with our comprehensive REST API. Built on Google's VEO technology with enterprise-grade security and reliability.
Developer Dashboard Coming Soon
We're putting the finishing touches on our self-serve developer dashboard with automated API key generation. Get early access and we'll provision your keys manually during the beta period.
Key Features
Lightning Fast
Generate videos in seconds with optimized processing
Secure
Enterprise-grade security with API key authentication
Scalable
Handle millions of requests with auto-scaling infrastructure
Simple
RESTful API with comprehensive documentation
Quick Start
Get your API key and start generating videos in minutes:
curl -X POST https://craft.video/api/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A serene mountain landscape at sunset",
"duration": 8,
"aspectRatio": "16:9",
"quality": "high"
}'Authentication
All API requests require authentication using your API key:
Authorization: Bearer YOUR_API_KEYSecurity Note: Never expose your API key in client-side code. Always make requests from your backend server.
API Endpoints
/api/generate
Generate a new AI video from a text prompt.
Request Body
{
"prompt": "A bustling city street at night with neon lights",
"duration": 16,
"aspectRatio": "16:9",
"quality": "high",
"audioText": "Welcome to the future of urban living",
"voiceType": "professional"
}Supported Aspect Ratios:
16:9- Standard landscape (all models)9:16- Portrait/vertical (all models)
Response
{
"success": true,
"videoId": "vid_abc123def456",
"status": "processing",
"estimatedTime": 45,
"creditsUsed": 8,
"webhook": "https://your-app.com/webhook"
}/api/video/:id
Check the status of a video generation request.
Response
{
"videoId": "vid_abc123def456",
"status": "completed",
"videoUrl": "https://craft.video/v/vid_abc123def456.mp4",
"thumbnailUrl": "https://craft.video/t/vid_abc123def456.jpg",
"duration": 16,
"createdAt": "2024-12-01T10:30:00Z",
"metadata": {
"prompt": "A bustling city street at night...",
"aspectRatio": "16:9",
"quality": "high"
}
}/api/credits/balance
Get current credit balance and usage statistics.
Response
{
"balance": 1250,
"totalCredits": 2000,
"usedCredits": 750,
"monthlyUsage": {
"current": 150,
"limit": 500
}
}Rate Limits
Error Codes
Official SDKs
JavaScript/Node.js
npm install @craft/sdkimport { CraftAPI } from '@craft/sdk';
const craft = new CraftAPI('your-api-key');
const video = await craft.generate({
prompt: 'A beautiful sunset over mountains',
duration: 8
});Python
pip install craft-pythonfrom craft import CraftAPI
craft = CraftAPI('your-api-key')
video = craft.generate(
prompt='A beautiful sunset over mountains',
duration=8
)