ElevenLabs குரல் AI
உணர்ச்சி கட்டுப்பாடு மற்றும் பல மொழிகளுடன் கூடிய மிகவும் இயற்கையான AI குரல்கள்.
✓ இயற்கையான குரல்கள்
✓ உணர்ச்சி கட்டுப்பாடு
✓ 29 மொழிகள்
✓ குரல் குளோனிங்
அங்கீகாரம்
Doitong API மூலம் ElevenLabs-ஐ அணுக, உங்கள் Doitong API கீயைப் பயன்படுத்தவும். இதை GraphQL மியூட்டேஷன் அல்லது REST 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
அளவுருக்கள் (Parameters)
ElevenLabs TTS API கோரிக்கைகளுக்கான அளவுருக்கள்:
| அளவுரு | வகை | கட்டாயம் | விளக்கம் |
|---|---|---|---|
service |
ஸ்ட்ரிங் | Yes | சேவை அடையாளங்காட்டி: "elevenlabs" |
version |
ஸ்ட்ரிங் | No | Model version: "eleven-turbo-v2" |
webhookUrl |
ஸ்ட்ரிங் | No | முடிவு அறிவிப்புகளைப் பெறுவதற்கான URL |
பதில் வடிவம் (Response Format)
அனைத்து 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
}
}
]
}
வெப்ஹூக்குகள் (Webhooks)
உங்கள் 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 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
தொடங்கத் தயாரா?
அற்புதமான உள்ளடக்கத்தை உருவாக்க ElevenLabs TTS API-ஐப் பயன்படுத்தும் ஆயிரக்கணக்கான டெவலப்பர்களுடன் இணையுங்கள்