Getting Started with AdMorph API

Learn how to integrate AdMorph's video generation capabilities into your applications

Quick Navigation

Overview

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.

Available Video Tools

Base URL

https://admorph.net/api/v1

Authentication

All API requests require authentication using an API key. You can create and manage your API keys from your dashboard settings.

1 Create an API Key

  1. Log in to your AdMorph account
  2. Navigate to Settings → API Keys
  3. Click "Create New Key"
  4. Give your key a descriptive name
  5. Save the key immediately (you won't be able to see it again!)

Important: API keys are only shown once during creation. Store them securely and never commit them to public repositories.

2 Using Your API Key

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"}'

Quick Start Guide

Let's create your first video using the Sora 2 endpoint. This example generates a 5-second video from a text prompt.

1 Make Your First 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 with mountains in the background",
    "mode": "text-to-video",
    "duration": "10",
    "orientation": "landscape"
  }'

2 Response

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"
  }
}

3 Check Status

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"

4 Get Your Video

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",
  ...
}

Code Examples

Python

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']}")

Node.js

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

<?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";
}

?>

Rate Limits

To ensure fair usage and system stability, the API enforces rate limits:

Response Headers

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

Webhooks

Instead of polling for submission status, configure a webhook to receive real-time notifications when your videos are ready.

Configure Webhook

  1. Navigate to Settings → Webhook Configuration
  2. Click "Configure Webhook"
  3. Enter your webhook URL
  4. Save the webhook secret for signature verification

Your webhook will receive POST requests with events like submission.completed and submission.failed.

View full webhook documentation →

Additional Resources

Need Help?

If you have questions or need assistance, reach out to our support team at help@admorph.net

← Back to Dashboard