API Documentation
Integrate AI image, video, and 3D generation into your applications with our comprehensive API.
Secure & Reliable
All API requests are encrypted with TLS and authenticated with API keys.
Authentication
All API requests require authentication using Bearer tokens. Include your API key in the Authorization header of every request.
Authorization: Bearer YOUR_API_KEYGetting Your API Key
- Log into your account
- Navigate to Settings → API Keys
- Click "Create New Key"
- Copy the key immediately (it won't be shown again)
Rate Limiting
Free Plan
100/hour
Requests per hour per API key
Pro Plan
500/hour
Requests per hour per API key
Enterprise
1000/hour
Requests per hour per API key
Rate Limit Headers
All API responses include headers showing your current rate limit status:
X-RateLimit-Limit:Maximum requests per hourX-RateLimit-Remaining:Remaining requests in current windowX-RateLimit-Reset:Unix timestamp when limit resetsClient Libraries
Python
Installation
# No official SDK yet - use requests libraryExample Usage
import requests
import json
API_KEY = "your_api_key_here"
BASE_URL = "https://yourdomain.com"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
# Generate an image
payload = {
"prompt": "A cyberpunk city at night with neon lights",
"aspect_ratio": "16:9",
"num_images": 1
}
response = requests.post(
f"{BASE_URL}/api/v1/images",
headers=headers,
json=payload
)
if response.status_code == 200:
data = response.json()
image_url = data["data"]["images"][0]["url"]
print(f"Image generated: {image_url}")
else:
print(f"Error: {response.json().get('error', 'Unknown error')}")JavaScript/Node.js
Installation
# Use native fetch or axiosExample Usage
const API_KEY = 'your_api_key_here';
const BASE_URL = 'https://yourdomain.com';
async function generateImage() {
const response = await fetch(`${BASE_URL}/api/v1/images`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
prompt: 'A futuristic cityscape with flying cars',
aspect_ratio: '16:9',
num_images: 1
})
});
const data = await response.json();
if (data.success) {
console.log('Image URL:', data.data.images[0].url);
} else {
console.error('Error:', data.error);
}
}
generateImage();cURL
Installation
# Works on any system with curlExample Usage
curl -X POST "https://yourdomain.com/api/v1/images" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A majestic eagle soaring over mountains at sunset",
"aspect_ratio": "16:9",
"output_format": "webp"
}'API Endpoints
Generate AI images from text prompts using various models.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Text description of the image |
aspect_ratiodefault: 1:1 | string | No | Image aspect ratio (1:1, 16:9, 4:3, etc.) |
output_formatdefault: png | string | No | Output format: png, jpeg, or webp |
num_imagesdefault: 1 | number | No | Number of images to generate (1-4) |
modeldefault: nano-banana | string | No | AI model to use |
Request Example
{
"prompt": "A beautiful sunset over mountains with reflection in a lake",
"aspect_ratio": "16:9",
"output_format": "webp",
"num_images": 2
}Response Example
{
"success": true,
"data": {
"images": [
{
"url": "https://cdn.example.com/image1.webp",
"content_type": "image/webp",
"file_name": "generated-image-12345-1.webp",
"file_size": 145678,
"width": 1920,
"height": 1080,
"aspect_ratio": "16:9"
}
],
"generation_id": "507f1f77bcf86cd799439011",
"generation_time": 2450,
"remaining_points": 92,
"request_id": "req_123456789"
}
}Generate AI videos from text prompts using Vidu Q2 or LTX-2 models.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Text description of the video |
modeldefault: vidu-q2 | string | No | AI model: vidu-q2 or ltx-2 |
durationdefault: 4 | number | No | Video duration in seconds |
resolutiondefault: 720p | string | No | Video resolution (360p, 520p, 720p, 1080p) |
aspect_ratiodefault: 16:9 | string | No | Video aspect ratio |
Request Example
{
"prompt": "A spaceship flying through a colorful nebula with stars in background",
"model": "vidu-q2",
"duration": 4,
"resolution": "720p",
"aspect_ratio": "16:9"
}Response Example
{
"success": true,
"data": {
"video": {
"url": "https://cdn.example.com/video-12345.mp4",
"content_type": "video/mp4",
"file_name": "generated-video-12345.mp4",
"file_size": 4567890,
"width": 1280,
"height": 720,
"duration": 4,
"resolution": "720p",
"aspect_ratio": "16:9",
"model": "vidu-q2",
"generation_id": "507f1f77bcf86cd799439012"
},
"generation_time": 32450,
"remaining_points": 82,
"request_id": "req_123456790"
}
}Convert images to 3D models using AI.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image_url | string | No | URL of the input image |
image_base64 | string | No | Base64 encoded image data |
texture_qualitydefault: standard | string | No | Texture quality: no or standard |
texture_alignmentdefault: original_image | string | No | Texture alignment method |
orientationdefault: default | string | No | Model orientation |
Request Example
{
"image_url": "https://example.com/object.jpg",
"texture_quality": "standard",
"texture_alignment": "original_image",
"orientation": "default"
}Response Example
{
"success": true,
"data": {
"model": {
"url": "https://cdn.example.com/model-12345.glb",
"preview_image": "https://cdn.example.com/preview-12345.jpg",
"content_type": "model/gltf-binary",
"file_name": "3d-model-12345.glb",
"file_size": 12345678,
"texture_quality": "standard",
"generation_id": "507f1f77bcf86cd799439013"
},
"generation_time": 45678,
"remaining_points": 62,
"request_id": "req_123456791"
}
}Retrieve your generated content with filtering and pagination.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
typedefault: all | string | No | Content type: all, images, videos, or 3d |
pagedefault: 1 | number | No | Page number for pagination |
limitdefault: 20 | number | No | Items per page (max 100) |
sortdefault: createdAt | string | No | Sort field |
orderdefault: desc | string | No | Sort order: asc or desc |
Request Example
GET /api/v1/projects?type=images&page=1&limit=10&sort=createdAt&order=descResponse Example
{
"success": true,
"data": {
"projects": [
{
"id": "507f1f77bcf86cd799439011",
"type": "image",
"prompt": "A beautiful sunset...",
"created_at": "2024-01-15T10:30:00Z",
"url": "https://cdn.example.com/image1.webp",
"thumbnail": "https://cdn.example.com/thumb1.webp",
"metadata": {
"aspect_ratio": "16:9",
"file_size": 145678,
"dimensions": "1920x1080"
}
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 45,
"pages": 5,
"has_more": true
}
}
}Need Help?
If you have any questions about our API, need help with integration, or want to request additional features, our support team is here to help.