Get Aleph Video Details
Retrieve comprehensive information about Runway Alpeh video generation tasks
Overview
Retrieve detailed information about your Runway Alpeh video generation tasks, including current status, generation parameters, video URLs, and error details. This endpoint is essential for monitoring task progress and accessing completed videos.Use this endpoint to poll task status if you’re not using callbacks, or to retrieve detailed information about completed tasks.
Authentication
Bearer token for API authentication. Get your API key from the API Key Management Page.Format:
Bearer YOUR_API_KEYQuery Parameters
Unique identifier of the Alpeh video generation task. This is the
taskId returned when you create a video generation request.Example: ee603959-debb-48d1-98c4-a6d1c717eba6Code Examples
curl -X GET "https://api.apikley.ru/api/v1/aleph/record-info?taskId=ee603959-debb-48d1-98c4-a6d1c717eba6" \
-H "Authorization: Bearer APIKLEY_API_KEY"
const getAlephVideoDetails = async (apiKey, taskId) => {
const response = await fetch(
`https://api.apikley.ru/api/v1/aleph/record-info?taskId=${taskId}`,
{
method: 'GET',
headers: {
'Authorization': `Bearer ${apiKey}`
}
}
);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const result = await response.json();
return result;
};
// Usage example
try {
const taskId = 'ee603959-debb-48d1-98c4-a6d1c717eba6';
const details = await getAlephVideoDetails('YOUR_API_KEY', taskId);
console.log('Task Status:', details.data.state);
if (details.data.successFlag === 1) {
console.log('Video URL:', details.data.response.resultVideoUrl);
console.log('Thumbnail URL:', details.data.response.resultImageUrl);
} else if (details.data.successFlag === 0 && details.data.errorMessage) {
console.error('Generation failed:', details.data.errorMessage);
} else {
console.log('Still processing...');
}
} catch (error) {
console.error('Error:', error.message);
}
import requests
import time
def get_aleph_video_details(api_key, task_id):
"""
Get details about an Aleph video generation task
Args:
api_key (str): Your API key
task_id (str): The task ID to check
Returns:
dict: Task details including status and video URLs
"""
url = f"https://api.apikley.ru/api/v1/aleph/record-info"
headers = {
"Authorization": f"Bearer {api_key}"
}
params = {
"taskId": task_id
}
try:
response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
result = response.json()
return result
except requests.exceptions.RequestException as e:
print(f"Request error: {e}")
raise
def wait_for_completion(api_key, task_id, check_interval=30, max_wait_time=1800):
"""
Poll task status until completion or timeout
Args:
api_key (str): Your API key
task_id (str): The task ID to monitor
check_interval (int): Seconds between status checks
max_wait_time (int): Maximum time to wait in seconds
Returns:
dict: Final task details
"""
start_time = time.time()
while time.time() - start_time < max_wait_time:
try:
details = get_aleph_video_details(api_key, task_id)
success_flag = details['data']['successFlag']
print(f"Task {task_id} status: {'success' if success_flag == 1 else 'processing' if success_flag == 0 and not details['data']['errorMessage'] else 'failed'}")
if success_flag == 1:
response_data = details['data']['response']
print(f"✅ Generation completed!")
print(f"Video URL: {response_data['resultVideoUrl']}")
print(f"Thumbnail URL: {response_data['resultImageUrl']}")
return details
elif success_flag == 0 and details['data']['errorMessage']:
print(f"❌ Generation failed: {details['data']['errorMessage']}")
return details
else:
print(f"⏳ Status: processing...")
time.sleep(check_interval)
except Exception as e:
print(f"Error checking status: {e}")
time.sleep(check_interval)
raise TimeoutError(f"Task did not complete within {max_wait_time} seconds")
# Usage example
if __name__ == "__main__":
api_key = "YOUR_API_KEY"
task_id = "ee603959-debb-48d1-98c4-a6d1c717eba6"
try:
# Get current status
details = get_aleph_video_details(api_key, task_id)
print(f"Current status: {details['data']['state']}")
# Wait for completion if still processing
if details['data']['state'] in ['wait', 'queueing', 'generating']:
final_details = wait_for_completion(api_key, task_id)
except Exception as e:
print(f"Error: {e}")
<?php
class AlephVideoMonitor {
private $apiKey;
private $baseUrl = 'https://api.apikley.ru';
public function __construct($apiKey) {
$this->apiKey = $apiKey;
}
/**
* Get Aleph video task details
*/
public function getTaskDetails($taskId) {
$url = $this->baseUrl . '/api/v1/aleph/record-detail?' . http_build_query([
'taskId' => $taskId
]);
$headers = [
'Authorization: Bearer ' . $this->apiKey
];
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_FOLLOWLOCATION => true
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
curl_close($ch);
if ($error) {
throw new Exception("cURL error: " . $error);
}
if ($httpCode !== 200) {
throw new Exception("HTTP error: " . $httpCode);
}
$result = json_decode($response, true);
if (json_last_error() !== JSON_ERROR_NONE) {
throw new Exception("JSON decode error: " . json_last_error_msg());
}
return $result;
}
/**
* Wait for task completion with polling
*/
public function waitForCompletion($taskId, $checkInterval = 30, $maxWaitTime = 1800) {
$startTime = time();
while (time() - $startTime < $maxWaitTime) {
try {
$details = $this->getTaskDetails($taskId);
$state = $details['data']['state'];
echo "Task $taskId status: $state\n";
if ($state === 'success') {
$videoInfo = $details['data']['videoInfo'];
echo "✅ Generation completed!\n";
echo "Video URL: " . $videoInfo['videoUrl'] . "\n";
echo "Thumbnail URL: " . $videoInfo['imageUrl'] . "\n";
return $details;
} elseif ($state === 'fail') {
echo "❌ Generation failed: " . $details['data']['failMsg'] . "\n";
return $details;
} elseif (in_array($state, ['wait', 'queueing', 'generating'])) {
echo "⏳ Status: $state...\n";
sleep($checkInterval);
} else {
echo "Unknown status: $state\n";
sleep($checkInterval);
}
} catch (Exception $e) {
echo "Error checking status: " . $e->getMessage() . "\n";
sleep($checkInterval);
}
}
throw new Exception("Task did not complete within $maxWaitTime seconds");
}
}
// Usage example
try {
$monitor = new AlephVideoMonitor('YOUR_API_KEY');
$taskId = 'ee603959-debb-48d1-98c4-a6d1c717eba6';
// Get current status
$details = $monitor->getTaskDetails($taskId);
echo "Current status: " . $details['data']['state'] . "\n";
// Wait for completion if still processing
$processingStates = ['wait', 'queueing', 'generating'];
if (in_array($details['data']['state'], $processingStates)) {
$finalDetails = $monitor->waitForCompletion($taskId);
}
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
}
?>
Response Format
Success Response
{
"code": 200,
"msg": "success",
"data": {
"taskId": "ee603959-debb-48d1-98c4-a6d1c717eba6",
"paramJson": "{\"prompt\":\"A majestic eagle soaring through mountain clouds at sunset\",\"imageUrl\":\"https://example.com/eagle-image.jpg\"}",
"response": {
"taskId": "ee603959-debb-48d1-98c4-a6d1c717eba6",
"resultVideoUrl": "https://file.com/k/xxxxxxx.mp4",
"resultImageUrl": "https://file.com/m/xxxxxxxx.png"
},
"completeTime": "2023-08-15T14:30:45Z",
"createTime": "2023-08-15T14:25:00Z",
"successFlag": 1,
"errorCode": 0,
"errorMessage": ""
}
}
{
"code": 200,
"msg": "success",
"data": {
"taskId": "ee603959-debb-48d1-98c4-a6d1c717eba6",
"paramJson": "{\"prompt\":\"A majestic eagle soaring through mountain clouds at sunset\",\"imageUrl\":\"https://example.com/eagle-image.jpg\"}",
"response": null,
"completeTime": null,
"createTime": "2023-08-15T14:25:00Z",
"successFlag": 0,
"errorCode": 0,
"errorMessage": ""
}
}
{
"code": 200,
"msg": "success",
"data": {
"taskId": "ee603959-debb-48d1-98c4-a6d1c717eba6",
"paramJson": "{\"prompt\":\"A majestic eagle soaring through mountain clouds at sunset\",\"imageUrl\":\"https://example.com/eagle-image.jpg\"}",
"response": null,
"completeTime": null,
"createTime": "2023-08-15T14:25:00Z",
"successFlag": 0,
"errorCode": 400,
"errorMessage": "Your prompt was caught by our AI moderator. Please adjust it and try again!"
}
}
Response Fields
HTTP status code
200: Request successful401: Unauthorized - Invalid API key404: Task not found422: Invalid task ID format500: Server error
Human-readable response message
Task details and status information
Show data properties
Show data properties
Unique identifier of the Alpeh video generation task
JSON string containing the original generation request parameters
Response data containing generated video information (null if not completed)
Timestamp when video generation was completed (null if not completed)
Timestamp when the task was created
Success status indicator
1: Video generated successfully0: Generation failed or still in progress
Error code when generation fails (0 if successful)
400: Content policy violation or technical error
Detailed error message explaining failure reason (empty if successful)
Task Status Understanding
Understanding the task status helps you handle various scenarios in your application:- Processing
- Success
- Failed
Status:
successFlag: 0 and no errorMessageWhat to do: Continue polling, generation is in progressTypical duration: 2-15 minutes depending on complexity and system loadStatus:
successFlag: 1What to do: Access video and thumbnail URLs from the response objectVideo availability: URLs are valid for 14 days after completionStatus:
successFlag: 0 and has errorMessageWhat to do: Check errorMessage for details, modify parameters if needed, retry if appropriateCommon causes: Content policy violations, image access issues, technical errorsError Handling
Task Not Found (404)
Task Not Found (404)
Cause: Invalid or non-existent task IDResponse:Solution: Verify the task ID is correct and was returned from a valid generation request
{
"code": 404,
"msg": "Task not found",
"data": null
}
Unauthorized (401)
Unauthorized (401)
Cause: Invalid or missing API keyResponse:Solution: Check your API key and ensure it’s properly formatted in the Authorization header
{
"code": 401,
"msg": "Unauthorized",
"data": null
}
Generation Failed
Generation Failed
Cause: Various issues during video generationCommon failure messages:
- “Your prompt was caught by our AI moderator” - Content policy violation
- “Failed to fetch the image” - Image URL inaccessible
- “Inappropriate content detected” - Image content violation
- “Upload failed due to network reasons” - Temporary technical issue
Polling Best Practices
Efficient Polling Strategy
Efficient Polling Strategy
Recommended intervals:
- First 5 minutes: Check every 30 seconds
- Next 10 minutes: Check every 60 seconds
- After 15 minutes: Check every 2-3 minutes
async function pollWithBackoff(taskId, apiKey) {
const intervals = [30, 30, 30, 30, 30, 60, 60, 120, 180];
for (let i = 0; i < intervals.length; i++) {
const details = await getAlephVideoDetails(apiKey, taskId);
const state = details.data.state;
if (state === 'success' || state === 'fail') {
return details;
}
await new Promise(resolve =>
setTimeout(resolve, intervals[i] * 1000)
);
}
throw new Error('Polling timeout');
}
Timeout Handling
Timeout Handling
Set reasonable timeouts:
- Most videos complete within 10-15 minutes
- Set maximum timeout of 30 minutes
- Implement exponential backoff for network errors
def poll_with_timeout(api_key, task_id, max_wait=1800):
start_time = time.time()
check_count = 0
while time.time() - start_time < max_wait:
try:
details = get_aleph_video_details(api_key, task_id)
state = details['data']['state']
if state in ['success', 'fail']:
return details
# Dynamic interval based on check count
interval = min(30 + (check_count * 10), 180)
time.sleep(interval)
check_count += 1
except Exception as e:
print(f"Polling error: {e}")
time.sleep(60) # Wait longer on errors
raise TimeoutError("Task polling timeout")
Error Recovery
Error Recovery
Handle temporary failures gracefully:
async function robustPolling(taskId, apiKey, maxRetries = 3) {
let retryCount = 0;
while (retryCount < maxRetries) {
try {
const details = await getAlephVideoDetails(apiKey, taskId);
if (details.data.state === 'success' || details.data.state === 'fail') {
return details;
}
// Reset retry count on successful request
retryCount = 0;
await new Promise(resolve => setTimeout(resolve, 30000));
} catch (error) {
retryCount++;
console.warn(`Polling attempt ${retryCount} failed:`, error.message);
if (retryCount >= maxRetries) {
throw new Error(`Polling failed after ${maxRetries} retries`);
}
// Exponential backoff for retries
const delay = Math.pow(2, retryCount) * 1000;
await new Promise(resolve => setTimeout(resolve, delay));
}
}
}
Integration Examples
React Hook for Video Generation
import { useState, useEffect } from 'react';
export function useAlephVideoGeneration(apiKey) {
const [tasks, setTasks] = useState(new Map());
const generateVideo = async (prompt, imageUrl, options = {}) => {
// Start generation
const response = await fetch('https://api.apikley.ru/api/v1/aleph/generate', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ prompt, imageUrl, ...options })
});
const result = await response.json();
const taskId = result.data.taskId;
// Add to tracking
setTasks(prev => new Map(prev).set(taskId, {
id: taskId,
state: 'wait',
prompt,
imageUrl,
startTime: Date.now()
}));
return taskId;
};
const checkTask = async (taskId) => {
const response = await fetch(
`https://api.apikley.ru/api/v1/aleph/record-info?taskId=${taskId}`,
{
headers: { 'Authorization': `Bearer ${apiKey}` }
}
);
const details = await response.json();
setTasks(prev => {
const updated = new Map(prev);
const existing = updated.get(taskId);
if (existing) {
updated.set(taskId, {
...existing,
...details.data,
lastChecked: Date.now()
});
}
return updated;
});
return details.data;
};
// Auto-polling for active tasks
useEffect(() => {
const activeTasks = Array.from(tasks.values())
.filter(task => ['wait', 'queueing', 'generating'].includes(task.state));
if (activeTasks.length === 0) return;
const interval = setInterval(async () => {
for (const task of activeTasks) {
try {
await checkTask(task.id);
} catch (error) {
console.error(`Error checking task ${task.id}:`, error);
}
}
}, 30000);
return () => clearInterval(interval);
}, [tasks]);
return {
tasks: Array.from(tasks.values()),
generateVideo,
checkTask
};
}
Related Documentation
Generate Aleph Video
Learn how to create video generation requests
Callback Integration
Implement webhooks instead of polling for better efficiency
Need Help? Contact our support team at support@apikley.ru for assistance with the Runway Alpeh API.
Rate limits and quotas are enforced by Apikley and may differ from upstream providers.
OpenAPI
runway-api/runway-aleph-api.json get /api/v1/aleph/record-info
openapi: 3.0.0
info:
title: Runway Alpeh API
description: Apikley Runway Alpeh API Documentation
version: 1.0.0
contact:
name: Technical Support
email: support@apikley.ru
servers:
- url: https://api.apikley.ru
description: API Server
security:
- BearerAuth: []
paths:
/api/v1/aleph/record-info:
get:
summary: Get Aleph Video Details
description: >-
Retrieve comprehensive information about an Aleph AI-generated video
task.
### Usage Guide
- Check the status of an Aleph video generation task
- Access video URLs when generation is complete
- Troubleshoot failed generation attempts
### Status Descriptions
- `successFlag`: 1 = success, 0 = failed or in progress
- Video links are valid for 14 days after completion
- Use this endpoint to poll task status if not using callbacks
### Developer Notes
- The response includes detailed task information including creation
time, completion time, and error details
- Parameter JSON contains the original generation request parameters
operationId: get-aleph-video-details
parameters:
- name: taskId
in: query
description: >-
Unique identifier of the Aleph video generation task. This is the
taskId returned when creating an Aleph video.
required: true
schema:
type: string
example: ee603959-debb-48d1-98c4-a6d1c717eba6
responses:
'200':
description: Request successful
content:
application/json:
schema:
allOf:
- type: object
properties:
code:
type: integer
enum:
- 200
- 401
- 404
- 422
- 429
- 451
- 455
- 500
description: >-
Response status code
- **200**: Success - Request has been processed
successfully
- **401**: Unauthorized - Authentication credentials
are missing or invalid
- **404**: Not Found - The requested resource or
endpoint does not exist
- **422**: Validation Error - The request parameters
failed validation checks
- **429**: Rate Limited - Request limit has been
exceeded for this resource
- **451**: Unauthorized - Failed to fetch the image.
Kindly verify any access limits set by you or your
service provider.
- **455**: Service Unavailable - System is currently
undergoing maintenance
- **500**: Server Error - An unexpected error occurred
while processing the request
msg:
type: string
description: Status message
example: success
data:
type: object
properties:
taskId:
type: string
description: >-
Unique identifier of the Aleph AI video generation
task
example: ee603959-debb-48d1-98c4-a6d1c717eba6
paramJson:
type: string
description: >-
JSON string containing the original generation
request parameters
example: >-
{"prompt":"A majestic eagle soaring through
mountain
clouds","videoUrl":"https://example.com/input-video.mp4"}
response:
type: object
description: >-
Response data containing generated video
information
properties:
taskId:
type: string
description: Task ID associated with this generation
example: ee603959-debb-48d1-98c4-a6d1c717eba6
resultVideoUrl:
type: string
description: >-
URL to access and download the generated
video, valid for 14 days
example: https://file.com/k/xxxxxxx.mp4
resultImageUrl:
type: string
description: >-
URL of a thumbnail image from the generated
video
example: https://file.com/m/xxxxxxxx.png
completeTime:
type: string
format: date-time
description: Timestamp when the video generation was completed
example: '2023-08-15T14:30:45Z'
createTime:
type: string
format: date-time
description: Timestamp when the task was created
example: '2023-08-15T14:25:00Z'
successFlag:
type: integer
format: int32
description: >-
Success status: 1 = success, 0 = failed or in
progress
enum:
- 0
- 1
example: 1
errorCode:
type: integer
format: int32
description: Error code when generation fails (0 if successful)
example: 0
errorMessage:
type: string
description: >-
Detailed error message explaining the reason for
failure (empty if successful)
example: ''
example:
code: 200
msg: success
data:
taskId: ee603959-debb-48d1-98c4-a6d1c717eba6
paramJson: >-
{"prompt":"A majestic eagle soaring through mountain clouds
at sunset","videoUrl":"https://example.com/input-video.mp4"}
response:
taskId: ee603959-debb-48d1-98c4-a6d1c717eba6
resultVideoUrl: https://file.com/k/xxxxxxx.mp4
resultImageUrl: https://file.com/m/xxxxxxxx.png
completeTime: '2023-08-15T14:30:45Z'
createTime: '2023-08-15T14:25:00Z'
successFlag: 1
errorCode: 0
errorMessage: ''
'500':
$ref: '#/components/responses/Error'
components:
responses:
Error:
description: Server Error
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: API Key
description: >-
All APIs require authentication via Bearer Token.
Get API Key:
1. Visit [API Key Management Page](https://app.apikley.ru/keys) to get your
API Key
Usage:
Add to request header:
Authorization: Bearer APIKLEY_API_KEY
Note:
- Keep your API Key secure and do not share it with others
- If you suspect your API Key has been compromised, reset it immediately
in the management page
To find navigation and other pages in this documentation, fetch the llms.txt file at: https://docs.apikley.ru/llms.txt