Minimax வீடியோ உருவாக்கம்
புத்திசாலித்தனமான காட்சி புரிதல் மற்றும் இயற்கையான அசைவுகளுடன் கூடிய மேம்பட்ட வீடியோ உருவாக்கம். உயர்தரத்திற்காக Hailuo மற்றும் HailuoI2V மாடல்கள் கிடைக்கின்றன.
✓ 1280x720 HD உருவாக்கம்
✓ 5-வினாடி வீடியோக்கள்
✓ புத்திசாலித்தனமான காட்சி புரிதல்
✓ படத்திலிருந்து வீடியோ ஆதரவு
அங்கீகாரம்
Doitong API மூலம் Minimax/Hailuo-ஐ அணுக, உங்கள் Doitong API கீயைப் பயன்படுத்தவும். இதை GraphQL மியூட்டேஷன் அல்லது REST API ஹெடர்களில் சேர்க்கவும்.
// GraphQL Header
{
"Authorization": "Bearer YOUR_API_KEY"
}
// REST Header
"X-API-Key": "YOUR_API_KEY"
விரைவான தொடக்கம்
சில நிமிடங்களில் Minimax / Hailuo-02 API-ஐப் பயன்படுத்தத் தொடங்குங்கள். உங்கள் முதல் text to video-ஐ உருவாக்க இந்த எளிய வழிமுறைகளைப் பின்பற்றவும்.
படி 1: உங்கள் API கீயைப் பெறுங்கள்
Doitong கணக்கிற்குப் பதிவு செய்து, API கீயை உருவாக்க உங்கள் டேஷ்போர்டிற்குச் செல்லவும்.
படி 2: உங்கள் முதல் கோரிக்கையை அனுப்பவும்
உங்கள் முதல் API அழைப்பை மேற்கொள்ள கீழே உள்ள குறியீடு உதாரணங்களில் ஒன்றைப் பயன்படுத்தவும்.
curl -X POST https://api.doitong.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: unique-request-id-123" \
-d '{
"query": "mutation Generate($input: GenerateInput!) { generate(input: $input) { id status type provider url metadata creditCost } }",
"variables": {
"input": {
"type": "VIDEO",
"provider": "minimax",
"input": {
"text": "A serene landscape with mountains and a lake at sunset"
},
"options": {
"duration": 5,
"aspectRatio": "16:9"
}
}
}
}'
const response = await fetch('https://api.doitong.com/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
'Idempotency-Key': 'unique-request-id-123'
},
body: JSON.stringify({
query: `
mutation Generate($input: GenerateInput!) {
generate(input: $input) {
id
status
type
provider
url
metadata
creditCost
}
}
`,
variables: {
input: {
type: 'VIDEO',
provider: 'minimax',
input: {
text: 'A serene landscape with mountains and a lake at sunset'
},
options: {
duration: 5,
aspectRatio: '16:9'
}
}
}
})
});
const data = await response.json();
console.log('Result:', data.data.generate);
import requests
import json
url = "https://api.doitong.com/graphql"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
}
query = """
mutation Generate($input: GenerateInput!) {
generate(input: $input) {
id
status
type
provider
url
metadata
creditCost
}
}
"""
variables = {
"input": {
"type": "VIDEO",
"provider": "minimax",
"input": {
"text": "A serene landscape with mountains and a lake at sunset"
},
"options": {
"duration": 5,
"aspectRatio": "16:9"
}
}
}
response = requests.post(url, json={
"query": query,
"variables": variables
}, headers=headers)
data = response.json()
print("Result:", data["data"]["generate"])
mutation Generate($input: GenerateInput!) {
generate(input: $input) {
id
status
type
provider
url
metadata
creditCost
createdAt
}
}
# Variables
{
"input": {
"type": "VIDEO",
"provider": "minimax",
"input": {
"text": "A serene landscape with mountains and a lake at sunset"
},
"options": {
"duration": 5,
"aspectRatio": "16:9",
"version": "hailuo-02",
"quality": "high"
}
}
}
கட்டண விவரம்
Minimax / Hailuo-02 API கிரெடிட் அடிப்படையிலான கட்டண முறையைப் பயன்படுத்துகிறது. உருவாக்கப்பட்ட உள்ளடக்கத்தின் சிக்கல் மற்றும் கால அளவைப் பொறுத்து கிரெடிட்கள் பயன்படுத்தப்படும்.
| அம்சம் | கிரெடிட்கள் | விளக்கம் |
|---|---|---|
| சாதாரண பயன்முறை | 100-200 கிரெடிட்கள் | சாதாரண தரத்தில் 5-10 வினாடி வீடியோ |
| புரோ பயன்முறை | 300-500 கிரெடிட்கள் | தொழில்முறை தரத்தில் 5-10 வினாடி வீடியோ |
API எண்ட்பாயிண்டுகள்
Minimax / Hailuo-02 API எங்களின் ஒருங்கிணைந்த GraphQL எண்ட்பாயிண்ட் மூலம் கிடைக்கிறது.
GraphQL எண்ட்பாயிண்ட்
POST https://api.doitong.com/graphql
REST எண்ட்பாயிண்ட்
POST https://api.doitong.com/v1/text_to_video
அளவுருக்கள் (Parameters)
Minimax / Hailuo-02 API கோரிக்கைகளுக்கான அளவுருக்கள்:
| அளவுரு | வகை | கட்டாயம் | விளக்கம் |
|---|---|---|---|
service |
ஸ்ட்ரிங் | Yes | சேவை அடையாளங்காட்டி: "minimax" |
prompt |
ஸ்ட்ரிங் | Yes | எதை உருவாக்க வேண்டும் என்பதற்கான உரை விளக்கம் |
duration |
இன்டிஜர் | No | வினாடிகளில் வீடியோ கால அளவு (இயல்புநிலை: 5) |
aspectRatio |
ஸ்ட்ரிங் | No | ஆஸ்பெக்ட் ரேஷியோ: "16:9", "9:16", "1:1" (இயல்புநிலை: "16:9") |
version |
ஸ்ட்ரிங் | No | Model version: "hailuo-02" |
webhookUrl |
ஸ்ட்ரிங் | No | முடிவு அறிவிப்புகளைப் பெறுவதற்கான URL |
பதில் வடிவம் (Response Format)
அனைத்து API பதில்களும் சீரான வடிவத்தைப் பின்பற்றுகின்றன:
வெற்றிகரமான பதில்
{
"data": {
"generatevideo": {
"id": "abc123xyz",
"status": "processing",
"url": null,
"webhookUrl": "https://your-webhook.com/callback",
"createdAt": "2024-01-01T00:00:00Z"
}
}
}
பூர்த்தி செய்யப்பட்ட பதில்
{
"data": {
"generatevideo": {
"id": "abc123xyz",
"status": "completed",
"url": "https://cdn.doitong.com/outputs/abc123xyz.mp4",
"duration": 5,
"createdAt": "2024-01-01T00:00:00Z"
}
}
}
பிழை கையாளுதல்
இந்த API நிலையான HTTP நிலைக் குறியீடுகளைப் பயன்படுத்துகிறது மற்றும் விரிவான பிழைச் செய்திகளை வழங்குகிறது.
பொதுவான பிழைக் குறியீடுகள்
| நிலைக் குறியீடு | பிழை வகை | விளக்கம் |
|---|---|---|
| 400 | Bad Request | Invalid parameters or malformed request |
| 401 | Unauthorized | Missing or invalid API key |
| 402 | Payment Required | Insufficient credits |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error, please retry |
பிழை பதில் வடிவம்
{
"errors": [
{
"message": "Insufficient credits for this operation",
"extensions": {
"code": "INSUFFICIENT_CREDITS",
"creditsRequired": 100,
"creditsAvailable": 50
}
}
]
}
வெப்ஹூக்குகள் (Webhooks)
உங்கள் text to video உருவாக்கம் முடிந்ததும் உடனுக்குடன் அறிவிப்புகளைப் பெறுங்கள்.
வெப்ஹூக்குகளை அமைத்தல்
Include a <code>webhookUrl</code> parameter in your request to receive a POST notification when processing is complete.
வெப்ஹூக் பேலோட்
{
"id": "abc123xyz",
"status": "completed",
"url": "https://cdn.doitong.com/outputs/abc123xyz.mp4",
"service": "minimax",
"createdAt": "2024-01-01T00:00:00Z",
"completedAt": "2024-01-01T00:01:00Z",
"metadata": {
"duration": 5,
"width": 1920,
"height": 1080
}
}
வெப்ஹூக் பாதுகாப்பு
அனைத்து வெப்ஹூக் கோரிக்கைகளும் சரிபார்ப்பிற்கான சிக்னேச்சர் ஹெடரைக் கொண்டிருக்கும்:
X-Doitong-Signature: sha256=abc123...
வேகக் கட்டுப்பாடுகள்
நியாயமான பயன்பாடு மற்றும் கணினி நிலைத்தன்மையை உறுதிப்படுத்த, பின்வரும் வேகக் கட்டுப்பாடுகள் பொருந்தும்:
| திட்டம் | கோரிக்கைகள்/நிமிடம் | ஒரே நேரத்தில் நடக்கும் பணிகள் | தினசரி வரம்பு |
|---|---|---|---|
| இலவசம் | 10 | 1 | 100 |
| ஸ்டார்ட்டர் | 30 | 3 | 1,000 |
| புரோ | 60 | 10 | 10,000 |
| என்டர்பிரைஸ் | தனிப்பயன் | தனிப்பயன் | வரம்பற்றது |
X-RateLimit-Limit: Maximum requests per windowX-RateLimit-Remaining: Requests remainingX-RateLimit-Reset: Window reset timestamp
சிறந்த நடைமுறைகள்
1. உங்கள் பிராம்ப்டுகளை மேம்படுத்துங்கள்
சிறந்த முடிவுகளுக்குத் தெளிவான, விளக்கமான பிராம்ப்டுகளை எழுதுங்கள்:
- Be specific about visual elements, style, and mood
- Include details about lighting, camera angles, and composition
- Avoid contradictory or impossible requests
2. ஏசின்க் (Async) செயலாக்கத்தைக் கையாளுதல்
உருவாக்கம் ஒத்திசைவற்றது (Asynchronous). முறையான போலிங் (polling) அல்லது வெப்ஹூக்குகளைச் செயல்படுத்தவும்:
// Polling example
async function pollStatus(jobId) {
let status = 'processing';
while (status === 'processing') {
await sleep(2000); // Wait 2 seconds
const result = await checkJobStatus(jobId);
status = result.status;
}
return result;
}
3. பிழை மீட்பு
எக்ஸ்போனென்ஷியல் பேக்-ஆஃப் (exponential backoff) முறையுடன் மீண்டும் முயற்சிக்கும் லாஜிக்கைச் செயல்படுத்தவும்:
async function retryWithBackoff(fn, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
return await fn();
} catch (error) {
if (i === maxRetries - 1) throw error;
await sleep(Math.pow(2, i) * 1000);
}
}
}
4. கிரெடிட் பயன்பாட்டைக் கண்காணிக்கவும்
தடங்கல்களைத் தவிர்க்க உங்கள் கிரெடிட் பயன்பாட்டைக் கண்காணிக்கவும்:
- Check credit balance before large batch operations
- Set up alerts for low credit thresholds
- Implement credit-aware request queuing
தொடங்கத் தயாரா?
அற்புதமான உள்ளடக்கத்தை உருவாக்க Minimax / Hailuo-02 API-ஐப் பயன்படுத்தும் ஆயிரக்கணக்கான டெவலப்பர்களுடன் இணையுங்கள்