ElevenLabs 음성 AI

감정 제어가 가능하며 다국어를 지원하는 가장 자연스러운 AI 음성 서비스입니다.

✓ 자연스러운 음성

✓ 감정 제어

✓ 29개 언어 지원

✓ 목소리 복제(Cloning)

인증

Doitong API를 통해 ElevenLabs에 액세스하려면 Doitong API 키를 사용하세요. GraphQL mutation 또는 REST API 헤더에 해당 키를 포함해야 합니다.

중요: Doitong API 키를 안전하게 보관하고 클라이언트 측 코드에 노출되지 않도록 주의하세요. API 호출은 항상 백엔드 서버에서 수행해야 합니다.
// GraphQL Header
{
  "Authorization": "Bearer YOUR_API_KEY"
}

// REST Header
"X-API-Key": "YOUR_API_KEY"

빠른 시작

단 몇 분 만에 ElevenLabs TTS API을(를) 시작해 보세요. 다음의 간단한 단계를 따라 첫 번째 tts을(를) 생성할 수 있습니다.

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" \
  -d '{
    "query": "mutation Generate($input: GenerateInput!) { generate(input: $input) { id status type provider url metadata creditCost } }",
    "variables": {
      "input": {
        "type": "AUDIO",
        "provider": "elevenlabs",
        "input": {
          "text": "Hello world, this is a text to speech example.",
          "voice": "en-US-neural"
        },
        "options": {
          "speed": 1.0
        }
      }
    }
  }'
const response = await fetch('https://api.doitong.com/graphql', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    query: `
      mutation GenerateSpeech($input: TTSInput!) {
        generateSpeech(input: $input) {
          id
          audioUrl
          duration
        }
      }
    `,
    variables: {
      input: {
        service: 'elevenlabs',
        text: 'Hello world, this is a text to speech example.',
        voice: 'en-US-neural',
        speed: 1.0
      }
    }
  })
});

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": "AUDIO",
        "provider": "elevenlabs",
        "input": {
            "text": "Hello world, this is a text to speech example.",
            "voice": "en-US-neural"
        },
        "options": {
            "speed": 1.0
        }
    }
}

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": "AUDIO",
    "provider": "elevenlabs",
    "input": {
      "text": "Hello world, this is a text to speech example.",
      "voice": "en-US-neural"
    },
    "options": {
      "speed": 1.0,
      "pitch": 1.0,
      "language": "en",
      "version": "eleven-turbo-v2"
    }
  }
}

요금제

ElevenLabs TTS API은(는) 크레딧 기반 요금 모델을 사용합니다. 생성된 콘텐츠의 복잡도와 길이에 따라 크레딧이 차감됩니다.

기능 크레딧 설명
표준 음성 100자당 1크레딧 기본 신경망 음성
프리미엄 음성 100자당 2크레딧 감정 표현이 가능한 고급 신경망 음성

API 엔드포인트

ElevenLabs TTS API은(는) 통합 GraphQL 엔드포인트를 통해 사용할 수 있습니다.

GraphQL 엔드포인트

POST https://api.doitong.com/graphql

REST 엔드포인트

POST https://api.doitong.com/v1/tts

파라미터

ElevenLabs TTS API 요청에 사용 가능한 파라미터:

파라미터 타입 필수 설명
service 문자열(String) Yes 서비스 식별자: "elevenlabs"
version 문자열(String) No Model version: "eleven-turbo-v2"
webhookUrl 문자열(String) No 완료 알림을 받을 URL

응답 형식

모든 API 응답은 일관된 형식을 따릅니다:

성공 응답

{
  "data": {
    "tts": {
      "id": "abc123xyz",
      "status": "processing",
      "url": null,
      "webhookUrl": "https://your-webhook.com/callback",
      "createdAt": "2024-01-01T00:00:00Z"
    }
  }
}

완료 응답

{
  "data": {
    "tts": {
      "id": "abc123xyz",
      "status": "completed",
      "url": "https://cdn.doitong.com/outputs/abc123xyz.mp3",
      "duration": null,
      "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
      }
    }
  ]
}

웹후크

tts 생성이 완료되면 실시간 알림을 받을 수 있습니다.

웹후크 설정하기

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.mp3",
  "service": "elevenlabs",
  "createdAt": "2024-01-01T00:00:00Z",
  "completedAt": "2024-01-01T00:01:00Z",
  "metadata": {
    "duration": null,
    "width": null,
    "height": null
  }
}

웹후크 보안

모든 웹후크 요청에는 검증을 위한 서명 헤더가 포함됩니다:

X-Doitong-Signature: sha256=abc123...

요청 제한

공정한 사용과 시스템 안정성을 위해 다음과 같은 요청 제한이 적용됩니다:

플랜 분당 요청 수 동시 작업 수 일일 제한
무료 10 1 100
스타터 30 3 1,000
프로 60 10 10,000
엔터프라이즈 맞춤형 맞춤형 무제한
요청 제한 헤더: 현재 제한 상태는 응답 헤더에서 확인할 수 있습니다:
  • X-RateLimit-Limit: Maximum requests per window
  • X-RateLimit-Remaining: Requests remaining
  • X-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

지금 시작해 보세요

수천 명의 개발자가 ElevenLabs TTS API을(를) 사용하여 놀라운 콘텐츠를 만들고 있습니다

API 키 받기 요금제 보기