Learn how to integrate AdMorph's video generation capabilities into your applications
The AdMorph API allows you to programmatically generate AI-powered videos using our suite of video generation tools. Whether you need text-to-video generation, product ads, or faceless videos, our API provides simple HTTP endpoints to integrate these capabilities into your applications.
https://admorph.net/api/v1
All API requests require authentication using an API key. You can create and manage your API keys from your dashboard settings.
Important: API keys are only shown once during creation. Store them securely and never commit them to public repositories.
Include your API key in the X-API-Key header with every request:
curl -X POST https://admorph.net/api/v1/sora2 \
-H "X-API-Key: adm_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"prompt": "A serene lake at sunset"}'
Let's create your first video using the Sora 2 endpoint. This example generates a 5-second video from a text prompt.
curl -X POST https://admorph.net/api/v1/sora2 \
-H "X-API-Key: adm_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A serene lake at sunset with mountains in the background",
"mode": "text-to-video",
"duration": "10",
"orientation": "landscape"
}'
You'll receive a submission object with a status of "pending":
{
"success": true,
"message": "Sora 2 submission created successfully",
"submission": {
"id": "507f1f77bcf86cd799439011",
"submissionType": "sora2",
"status": "submitted",
"sora2Prompt": "A serene lake at sunset with mountains in the background",
"sora2Mode": "text-to-video",
"sora2Orientation": "landscape",
"sora2Duration": 10,
"creditsRequired": 1,
"createdAt": "2025-01-15T10:30:00.000Z",
"estimatedCompletionTime": "2025-01-15T10:40:00.000Z"
}
}
Use the submission ID to check the status:
curl -X GET https://admorph.net/api/v1/507f1f77bcf86cd799439011 \ -H "X-API-Key: adm_live_your_api_key_here"
When status is "completed", the video URL will be available in the video_1 field:
{
"_id": "507f1f77bcf86cd799439011",
"status": "completed",
"video_1": "https://admorph.net/videos/output_123.mp4",
...
}
import requests
API_KEY = "adm_live_your_api_key_here"
BASE_URL = "https://admorph.net/api/v1"
headers = {
"X-API-Key": API_KEY,
"Content-Type": "application/json"
}
# Create a video submission
response = requests.post(
f"{BASE_URL}/submissions/sora2",
headers=headers,
json={
"prompt": "A serene lake at sunset",
"mode": "text-to-video",
"duration": "10",
"orientation": "landscape"
}
)
submission = response.json()["submission"]
submission_id = submission["_id"]
print(f"Submission created: {submission_id}")
# Check status
status_response = requests.get(
f"{BASE_URL}/submissions/{submission_id}",
headers=headers
)
result = status_response.json()
print(f"Status: {result['status']}")
if result["status"] == "completed":
print(f"Video URL: {result['video_1']}")
const axios = require('axios');
const API_KEY = 'adm_live_your_api_key_here';
const BASE_URL = 'https://admorph.net/api/v1';
const headers = {
'X-API-Key': API_KEY,
'Content-Type': 'application/json'
};
async function createVideo() {
try {
// Create submission
const response = await axios.post(
`${BASE_URL}/submissions/sora2`,
{
prompt: 'A serene lake at sunset',
mode: 'text-to-video',
duration: '10',
orientation: 'landscape'
},
{ headers }
);
const submissionId = response.data.submission._id;
console.log(`Submission created: ${submissionId}`);
// Check status
const statusResponse = await axios.get(
`${BASE_URL}/submissions/${submissionId}`,
{ headers }
);
console.log(`Status: ${statusResponse.data.status}`);
if (statusResponse.data.status === 'completed') {
console.log(`Video URL: ${statusResponse.data.video_1}`);
}
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}
}
createVideo();
<?php
$apiKey = 'adm_live_your_api_key_here';
$baseUrl = 'https://admorph.net/api/v1';
// Create submission
$data = [
'prompt' => 'A serene lake at sunset',
'mode' => 'text-to-video',
'duration' => '10',
'orientation' => 'landscape'
];
$ch = curl_init("$baseUrl/submissions/sora2");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: ' . $apiKey,
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
$submissionId = $result['submission']['_id'];
echo "Submission created: $submissionId\n";
// Check status
$ch = curl_init("$baseUrl/submissions/$submissionId");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: ' . $apiKey
]);
$statusResponse = curl_exec($ch);
curl_close($ch);
$status = json_decode($statusResponse, true);
echo "Status: " . $status['status'] . "\n";
if ($status['status'] === 'completed') {
echo "Video URL: " . $status['video_1'] . "\n";
}
?>
To ensure fair usage and system stability, the API enforces rate limits:
X-RateLimit-Limit: 100 X-RateLimit-Remaining: 95 X-RateLimit-Reset: 1642258800
Tip: If you need higher rate limits for production use, contact us at help@admorph.net
Instead of polling for submission status, configure a webhook to receive real-time notifications when your videos are ready.
Your webhook will receive POST requests with events like submission.completed and submission.failed.
If you have questions or need assistance, reach out to our support team at help@admorph.net