AI 콘텐츠 생성을 위한 통합 API 솔루션
단 하나의 통합 API로 30개 이상의 최첨단 AI 모델을 만나보세요. 업계 최고 수준의 비디오, 이미지, 아바타 및 음성 생성이 가능합니다.
텍스트 투 비디오 API
세계에서 가장 진보된 AI 비디오 모델을 통해 텍스트 프롬프트를 놀라운 영상으로 변환하세요.
6가지 버전(1.0-2.1)을 지원하는 업계 선도적인 비디오 생성 모델입니다. 표준 및 프로 모드, 5-10초 영상, 뛰어난 움직임 일관성을 자랑합니다.
뛰어난 장면 이해도와 자연스러운 움직임을 제공하는 고급 비디오 생성 모델입니다. Hailuo-02 및 HailuoI2V 모델을 사용할 수 있습니다.
비교할 수 없는 사실감과 물리적 정확도를 갖춘 Google의 최신 비디오 모델입니다. 프리미엄 품질의 결과물을 보장합니다.
Gen-2, Gen-3, Gen4 모델을 통한 전문적인 이미지 애니메이션 기능을 제공합니다. 영화 같은 퀄리티의 결과물을 얻을 수 있습니다.
Dream Machine을 활용한 예술적 비디오 생성 모델입니다. 독특한 미학을 가진 초현실적이고 창의적인 영상을 제작하세요.
다인원 안무 지원이 포함된 고급 댄스 합성 모델입니다. 참조 영상을 기반으로 동기화된 댄스 비디오를 생성합니다.
안정적인 5초 클립 생성에 특화되어 있습니다. 480p 및 1080p 해상도로 신뢰할 수 있는 품질을 제공합니다.
텍스트 투 이미지 API
최신 확산 모델(Diffusion Models)을 사용하여 텍스트 설명만으로 멋진 이미지를 제작하세요.
Google's most advanced image model with photorealistic quality and exceptional prompt adherence. Multiple sub-models available.
빠른 반복 작업을 위한 개발용 모델입니다. 프로토타이핑을 위해 속도와 품질 사이의 완벽한 균형을 제공합니다.
향상된 디테일과 예술적 제어 기능을 갖춘 전문가용 이미지 생성 모델입니다. 뛰어난 안정성을 제공합니다.
Enhanced version with improved prompt understanding and faster generation times. Better composition.
최고 품질의 이미지 생성 모델입니다. 까다로운 프로젝트를 위한 극강의 디테일과 해상도를 제공합니다.
Specialized for context-aware generation with Pro and Max modes. Excellent for specific style requirements.
빠른 생성을 위해 여러 품질 계층을 제공하도록 최적화된 Flux 구현체입니다.
뛰어난 예술적 이해도와 스타일 제어 기능을 갖춘 고급 중국어 기반 이미지 모델입니다.
이미지 투 비디오 API
지능형 모션 및 애니메이션 기술로 정지된 이미지에 생동감을 불어넣으세요.
Transform images into smooth videos with natural motion. Multiple versions and quality modes available.
아바타, 립싱크 및 TTS API
말하는 아바타를 생성하고 완벽한 싱크의 자연스러운 음성을 합성하세요.
완벽한 오디오 싱크를 지원하는 캐릭터 애니메이션 모델입니다. 자연스러운 표정과 움직임으로 초상화에 생명력을 불어넣으세요.
감정 조절이 가능하고 다양한 언어를 지원하는 가장 자연스러운 AI 목소리를 제공합니다.
하나의 API, 무한한 가능성
🎯 통합 생성 기능
비디오, 이미지, 오디오, 아바타 등 모든 콘텐츠 유형에 단일 'generate' 메서드를 사용합니다. 일관된 API로 통합 과정을 단순화하세요.
🤖 스마트한 모델 선택
요구 사항에 따라 AI가 최적의 모델 제공사를 자동으로 선택하도록 하거나, 직접 지정하여 완벽하게 제어할 수 있습니다.
🔄 멱등성 요청 보장
Idempotency-Key 헤더를 통해 안전하게 재시도하세요. 네트워크 문제로 인한 중복 결제 걱정이 없습니다.
📊 지능형 속도 제한
명확한 속도 제한 헤더(X-RateLimit-*)를 제공하여 요청 타이밍을 최적화하고 429 에러를 방지할 수 있도록 돕습니다.
🔔 보안 웹훅
HMAC 서명 웹훅으로 안전한 비동기 알림을 받으세요. 콘텐츠 생성이 완료되는 즉시 알려드립니다.
⚡ 명확한 에러 코드
INSUFFICIENT_CREDITS, RATE_LIMIT 등 기계 읽기 가능한 에러 코드로 디버깅이 더욱 쉬워집니다.
주요 에러 코드
| 코드 | 설명 | 조치 방법 |
|---|---|---|
| INSUFFICIENT_CREDITS | 작업을 수행하기 위한 크레딧이 부족합니다 | 계정 크레딧을 충전하세요 |
| RATE_LIMIT | 요청 횟수가 너무 많습니다 | X-RateLimit-Reset 헤더를 확인하세요 |
| INVALID_INPUT | 유효하지 않은 파라미터가 전달되었습니다 | 입력값이 스키마에 맞는지 확인하세요 |
| PROVIDER_UNAVAILABLE | 선택한 모델 제공사를 일시적으로 사용할 수 없습니다 | 잠시 후 재시도하거나 자동 선택 기능을 사용하세요 |
| GENERATION_FAILED | 콘텐츠 생성에 실패했습니다 | 다른 파라미터로 다시 시도해 보세요 |
플랜별 속도 제한
| 플랜 | 분당 요청 수 | 동시 연결 수 | 일일 제한 |
|---|---|---|---|
| Free | 10 | 1 | 100 |
| Starter | 30 | 3 | 1,000 |
| Pro | 60 | 10 | 10,000 |
| Enterprise | Custom | Custom | Unlimited |
빠른 시작 코드 예시
# Universal generation API - Video example
curl -X POST https://api.doitong.com/graphql \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: unique-request-id-123" \
-d '{
"query": "mutation Generate($input: GenerateInput!) { generate(input: $input) { id status type provider url metadata { duration resolution } creditCost estimatedTime } }",
"variables": {
"input": {
"type": "VIDEO",
"provider": "minimax",
"input": {
"text": "A serene mountain landscape at sunset"
},
"options": {
"duration": 10,
"resolution": "1080p",
"style": "cinematic"
}
}
}
}'
# Auto-select best provider for quality
curl -X POST https://api.doitong.com/graphql \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation { generate(input: { type: VIDEO, input: { text: \"Epic dragon battle\" }, priority: QUALITY }) { id status provider creditCost } }"
}'
# Check generation status
curl -X POST https://api.doitong.com/graphql \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "query { generation(id: \"gen_abc123\") { status progress url error { code message } } }"
}'
// Doitong Universal API Client
class DoitongAPI {
constructor(apiKey) {
this.apiKey = apiKey;
this.endpoint = 'https://api.doitong.com/graphql';
}
async generate(input) {
const response = await fetch(this.endpoint, {
method: 'POST',
headers: {
'Authorization': `Bearer ${this.apiKey}`,
'Content-Type': 'application/json',
'Idempotency-Key': crypto.randomUUID()
},
body: JSON.stringify({
query: `
mutation Generate($input: GenerateInput!) {
generate(input: $input) {
id
status
type
provider
url
metadata
creditCost
estimatedTime
error {
code
message
}
}
}
`,
variables: { input }
})
});
const data = await response.json();
// Check for rate limits
const remaining = response.headers.get('X-RateLimit-Remaining');
if (remaining && parseInt(remaining) < 10) {
console.warn(`Low rate limit: ${remaining} requests remaining`);
}
if (data.errors) {
throw new Error(data.errors[0].message);
}
return data.data.generate;
}
async checkStatus(id) {
const response = await fetch(this.endpoint, {
method: 'POST',
headers: {
'Authorization': `Bearer ${this.apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: `
query GetGeneration($id: ID!) {
generation(id: $id) {
id
status
progress
url
error {
code
message
}
}
}
`,
variables: { id }
})
});
const data = await response.json();
return data.data.generation;
}
async waitForCompletion(id, pollInterval = 2000) {
while (true) {
const result = await this.checkStatus(id);
if (result.status === 'COMPLETED') {
return result;
} else if (result.status === 'FAILED') {
throw new Error(result.error?.message || 'Generation failed');
}
await new Promise(resolve => setTimeout(resolve, pollInterval));
}
}
}
// Usage examples
const api = new DoitongAPI('YOUR_API_KEY');
// Simple video generation - let AI choose provider
const video = await api.generate({
type: 'VIDEO',
input: { text: 'A serene mountain landscape' }
});
// Specific provider with options
const video = await api.generate({
type: 'VIDEO',
provider: 'minimax',
input: { text: 'Epic battle scene' },
options: {
duration: 10,
resolution: '1080p',
style: 'cinematic'
}
});
// Image generation with auto-provider selection for quality
const image = await api.generate({
type: 'IMAGE',
input: { text: 'Photorealistic portrait' },
priority: 'QUALITY'
});
// Wait for completion
const result = await api.waitForCompletion(video.id);
console.log('Video ready:', result.url);
// Using Apollo Client for GraphQL
import { ApolloClient, gql } from '@apollo/client';
const CREATE_VIDEO = gql`
mutation CreateVideo($input: VideoCreateInput!) {
videoCreate(input: $input) {
id
status
videoUrl
}
}
`;
const client = new ApolloClient({
uri: 'https://api.doitong.com/graphql',
headers: {
authorization: 'Bearer YOUR_API_KEY'
}
});
const result = await client.mutate({
mutation: CREATE_VIDEO,
variables: {
input: {
prompt: 'Beautiful sunset over ocean',
model: 'luma',
duration: 9
}
}
});
import requests
import time
import json
import uuid
from typing import Dict, Optional, Any
class DoitongAPI:
def __init__(self, api_key: str):
self.api_key = api_key
self.base_url = "https://api.doitong.com/graphql"
self.headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
def generate(self,
content_type: str,
input_data: Dict[str, Any],
provider: Optional[str] = None,
options: Optional[Dict] = None,
idempotency_key: Optional[str] = None) -> Dict:
"""Universal generation method for all content types"""
# Add idempotency key for safe retries
headers = self.headers.copy()
if idempotency_key:
headers["Idempotency-Key"] = idempotency_key
else:
headers["Idempotency-Key"] = str(uuid.uuid4())
query = """
mutation Generate($input: GenerateInput!) {
generate(input: $input) {
id
status
type
provider
url
metadata
creditCost
estimatedTime
error
errorCode
}
}
"""
variables = {
"input": {
"type": content_type.upper(),
"input": input_data
}
}
if provider:
variables["input"]["provider"] = provider
if options:
variables["input"]["options"] = options
response = requests.post(
self.base_url,
headers=headers,
json={"query": query, "variables": variables}
)
# Handle rate limiting
if response.status_code == 429:
retry_after = response.headers.get("X-RateLimit-Reset", 60)
raise Exception(f"Rate limited. Retry after {retry_after} seconds")
data = response.json()
if "errors" in data:
error = data["errors"][0]
raise Exception(f"API Error: {error.get('message', 'Unknown error')}")
return data["data"]["generate"]
def check_status(self, generation_id: str) -> Dict:
"""Check the status of a generation"""
query = """
query GetGeneration($id: ID!) {
generation(id: $id) {
id
status
type
url
progress
error
errorCode
metadata
}
}
"""
response = requests.post(
self.base_url,
headers=self.headers,
json={
"query": query,
"variables": {"id": generation_id}
}
)
return response.json()["data"]["generation"]
def wait_for_completion(self, generation_id: str, max_wait: int = 300) -> Dict:
"""Poll until generation is complete"""
start_time = time.time()
while time.time() - start_time < max_wait:
result = self.check_status(generation_id)
if result["status"] == "completed":
return result
elif result["status"] == "failed":
error_code = result.get("errorCode", "UNKNOWN_ERROR")
error_msg = result.get("error", "Generation failed")
raise Exception(f"[{error_code}] {error_msg}")
# Adaptive polling - start fast, slow down over time
wait_time = 2 if time.time() - start_time < 30 else 5
time.sleep(wait_time)
raise TimeoutError("Generation timed out")
# Example usage
if __name__ == "__main__":
api = DoitongAPI("YOUR_API_KEY")
try:
# Generate a video (auto-selects best provider)
video = api.generate(
content_type="video",
input_data={"text": "A majestic eagle soaring through clouds"},
options={"duration": 10, "resolution": "1080p"}
)
print(f"Video generation started: {video['id']}")
# Wait for completion
result = api.wait_for_completion(video['id'])
print(f"Video ready: {result['url']}")
print(f"Credits used: {result['creditCost']}")
# Generate with specific provider
image = api.generate(
content_type="image",
provider="flux-ultra",
input_data={"text": "Professional product photography"},
options={"aspectRatio": "16:9", "quality": "ultra"}
)
# Generate audio/TTS
audio = api.generate(
content_type="audio",
provider="elevenlabs",
input_data={"text": "Welcome to the future of AI"},
options={"voice": "rachel", "emotion": "excited"}
)
except Exception as e:
print(f"Error: {e}")
# Universal generation mutation - works for all content types
mutation Generate($input: GenerateInput!) {
generate(input: $input) {
id
status
type
provider
url
metadata
creditCost
estimatedTime
progress
error
errorCode
}
}
# Example: Generate video (auto-select provider)
# Variables:
{
"input": {
"type": "VIDEO",
"input": {
"text": "A bustling Tokyo street at night with neon lights"
},
"options": {
"duration": 10,
"resolution": "1080p",
"style": "cinematic"
}
}
}
# Example: Generate video with specific provider
# Variables:
{
"input": {
"type": "VIDEO",
"provider": "kling",
"input": {
"text": "Epic space battle scene"
},
"options": {
"mode": "pro",
"duration": 10,
"aspectRatio": "16:9"
}
}
}
# Example: Image-to-video generation
# Variables:
{
"input": {
"type": "VIDEO",
"provider": "runway",
"input": {
"text": "Make the character dance",
"image": "https://example.com/character.jpg"
},
"options": {
"motionIntensity": "high",
"model": "gen-3"
}
}
}
# Example: Generate image
# Variables:
{
"input": {
"type": "IMAGE",
"provider": "flux-ultra",
"input": {
"text": "Photorealistic portrait in Rembrandt style"
},
"options": {
"aspectRatio": "16:9",
"quality": "ultra",
"seed": 42
}
}
}
# Example: Generate audio/TTS
# Variables:
{
"input": {
"type": "AUDIO",
"provider": "elevenlabs",
"input": {
"text": "Welcome to the future of artificial intelligence"
},
"options": {
"voice": "rachel",
"emotion": "excited",
"speed": 1.0
}
}
}
# Example: Generate avatar video
# Variables:
{
"input": {
"type": "AVATAR",
"provider": "heygen",
"input": {
"text": "Hello, I'm your AI assistant",
"voice": "professional_female"
},
"options": {
"avatarId": "kate",
"background": "modern_office",
"gesture": "friendly"
},
"webhookUrl": "https://your-app.com/webhook"
}
}
# Query generation status
query GetGeneration($id: ID!) {
generation(id: $id) {
id
status
type
provider
url
progress
metadata {
width
height
duration
format
}
creditCost
error
errorCode
createdAt
completedAt
}
}
# Cancel a generation
mutation CancelGeneration($id: ID!) {
cancelGeneration(id: $id)
}
# Get available providers for a content type
query GetProviders($type: GenerationType!) {
providers(type: $type) {
id
name
description
features
limitations
pricing {
creditCost
estimatedTime
}
options {
name
type
required
description
allowedValues
}
}
}
}
놀라운 서비스를 만들 준비가 되셨나요?
이미 수천 명의 개발자가 당사의 API를 사용하여 차세대 AI 콘텐츠를 만들고 있습니다.