Runway 크리에이티브 스위트
Gen-2, Gen-3, Gen4 모델을 사용한 전문적인 이미지 애니메이션 서비스입니다. 영화 같은 품질의 결과물을 제공합니다.
✓ Gen-2, Gen-3, Gen4 모델
✓ 이미지 애니메이션
✓ 모션 제어
✓ HD 화질
인증
Doitong API를 통해 Runway에 액세스하려면 Doitong API 키를 사용하세요. GraphQL mutation 또는 REST API 헤더에 해당 키를 포함해야 합니다.
// GraphQL Header
{
"Authorization": "Bearer YOUR_API_KEY"
}
// REST Header
"X-API-Key": "YOUR_API_KEY"
빠른 시작
단 몇 분 만에 Runway Gen4 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": "runway",
"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: 'runway',
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": "runway",
"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": "runway",
"input": {
"text": "A serene landscape with mountains and a lake at sunset"
},
"options": {
"duration": 5,
"aspectRatio": "16:9",
"version": "gen-4",
"quality": "high"
}
}
}
요금제
Runway Gen4 API은(는) 크레딧 기반 요금 모델을 사용합니다. 생성된 콘텐츠의 복잡도와 길이에 따라 크레딧이 차감됩니다.
| 기능 | 크레딧 | 설명 |
|---|---|---|
| 표준 모드 | 100-200 크레딧 | 5~10초 분량의 표준 화질 비디오 |
| 프로 모드 | 300-500 크레딧 | 5~10초 분량의 전문가급 화질 비디오 |
API 엔드포인트
Runway Gen4 API은(는) 통합 GraphQL 엔드포인트를 통해 사용할 수 있습니다.
GraphQL 엔드포인트
POST https://api.doitong.com/graphql
REST 엔드포인트
POST https://api.doitong.com/v1/text_to_video
파라미터
Runway Gen4 API 요청에 사용 가능한 파라미터:
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
service |
문자열(String) | Yes | 서비스 식별자: "runway" |
prompt |
문자열(String) | Yes | 생성할 내용에 대한 텍스트 설명 |
duration |
정수(Integer) | No | 비디오 길이(초) (기본값: 5) |
aspectRatio |
문자열(String) | No | 화면 비율: "16:9", "9:16", "1:1" (기본값: "16:9") |
version |
문자열(String) | No | Model version: "gen-2", "gen-3", "gen-4" |
webhookUrl |
문자열(String) | No | 완료 알림을 받을 URL |
응답 형식
모든 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
}
}
]
}
웹후크
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": "runway",
"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. 비동기 처리 관리
생성 작업은 비동기로 이루어집니다. 적절한 폴링이나 웹후크를 구현하세요:
// 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
지금 시작해 보세요
수천 명의 개발자가 Runway Gen4 API을(를) 사용하여 놀라운 콘텐츠를 만들고 있습니다