# 1. List voices to get voice_id
curl https://api.j1tts.com/v1/voices \
-H "Authorization: Bearer sk-j1tts-YOUR_KEY"
# 2. Submit TTS job
curl -X POST https://api.j1tts.com/v1/tts \
-H "Authorization: Bearer sk-j1tts-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Hello world", "voice_id": "VOICE_ID", "file_name": "output.mp3"}'
# Response: {"id": "abc123", "status": "processing"}
# 3. Poll until completed
curl https://api.j1tts.com/v1/tts/abc123 \
-H "Authorization: Bearer sk-j1tts-YOUR_KEY"
# Response: {"id":"abc123","status":"completed","download_url":"/v1/tts/abc123/download"}
# 4. Download MP3
curl -L https://api.j1tts.com/v1/tts/abc123/download \
-H "Authorization: Bearer sk-j1tts-YOUR_KEY" \
-o output.mp3
# 5. Check usage
curl https://api.j1tts.com/v1/usage \
-H "Authorization: Bearer sk-j1tts-YOUR_KEY"
# 6. List YOUR imported voices
curl https://api.j1tts.com/v1/my-voices \
-H "Authorization: Bearer sk-j1tts-YOUR_KEY"
# 7. Import voice(s) by ElevenLabs ID (comma-separated for batch)
curl -X POST https://api.j1tts.com/v1/voices/import \
-H "Authorization: Bearer sk-j1tts-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"voice_ids": "id1,id2,id3"}'
import time, requests
API_KEY = "sk-j1tts-YOUR_KEY"
BASE = "https://api.j1tts.com"
H = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
# 1. List voices
voices = requests.get(f"{BASE}/v1/voices", headers=H).json()["voices"]
voice_id = voices[0]["voice_id"] # pick a voice
# (Optional) list YOUR imported voices
my_voices = requests.get(f"{BASE}/v1/my-voices", headers=H).json()["voices"]
# 2. Submit TTS job
res = requests.post(f"{BASE}/v1/tts", headers=H, json={
"text": "Hello world",
"voice_id": voice_id,
"file_name": "output.mp3" # optional
})
job_id = res.json()["id"]
# 3. Poll until completed
while True:
status = requests.get(f"{BASE}/v1/tts/{job_id}", headers=H).json()
if status["status"] == "completed":
break
elif status["status"] == "failed":
raise Exception(status.get("error", "Failed"))
time.sleep(2)
# 4. Download MP3
audio = requests.get(f"{BASE}/v1/tts/{job_id}/download", headers=H)
with open("output.mp3", "wb") as f:
f.write(audio.content)
print("Done! Saved to output.mp3")
# 5. Check usage
usage = requests.get(f"{BASE}/v1/usage", headers=H).json()
print(f"Used today: {usage['used_today']} / {usage['daily_limit']}")
# 6. Import voice(s) by ElevenLabs ID
imported = requests.post(f"{BASE}/v1/voices/import", headers=H, json={
"voice_ids": "elVoiceId1,elVoiceId2" # comma-separated
}).json()
print(f"Imported: {imported.get('imported', [])}")
const KEY = "sk-j1tts-YOUR_KEY";
const BASE = "https://api.j1tts.com";
const H = { "Authorization": `Bearer ${KEY}`, "Content-Type": "application/json" };
// 1. List voices
const { voices } = await fetch(`${BASE}/v1/voices`, { headers: H }).then(r => r.json());
const voiceId = voices[0].voice_id; // pick a voice
// (Optional) list YOUR imported voices
const { voices: myVoices } = await fetch(`${BASE}/v1/my-voices`, { headers: H }).then(r => r.json());
// 2. Submit TTS job
const { id } = await fetch(`${BASE}/v1/tts`, {
method: "POST", headers: H,
body: JSON.stringify({ text: "Hello world", voice_id: voiceId, file_name: "output.mp3" })
}).then(r => r.json());
// 3. Poll until completed
let job;
do {
await new Promise(r => setTimeout(r, 2000));
job = await fetch(`${BASE}/v1/tts/${id}`, { headers: H }).then(r => r.json());
} while (job.status !== "completed" && job.status !== "failed");
if (job.status === "failed") throw new Error(job.error);
// 4. Download MP3 (browser)
const blob = await fetch(`${BASE}/v1/tts/${id}/download`, { headers: H }).then(r => r.blob());
const a = Object.assign(document.createElement("a"), {
href: URL.createObjectURL(blob), download: "output.mp3"
});
a.click();
// 5. Import voice(s)
const imported = await fetch(`${BASE}/v1/voices/import`, {
method: "POST", headers: H,
body: JSON.stringify({ voice_ids: "elId1,elId2" })
}).then(r => r.json());
console.log("Imported:", imported.imported);
# GET /v1/voices — vozes globais (adicionadas pelo admin)
curl https://api.j1tts.com/v1/voices \
-H "Authorization: Bearer sk-j1tts-YOUR_KEY"
# GET /v1/my-voices — tuas vozes importadas
curl https://api.j1tts.com/v1/my-voices \
-H "Authorization: Bearer sk-j1tts-YOUR_KEY"
# POST /v1/voices/import — importar vozes do ElevenLabs (ate 100 por request)
# Aceita um ou varios voice_ids separados por virgula em "voice_ids".
curl -X POST https://api.j1tts.com/v1/voices/import \
-H "Authorization: Bearer sk-j1tts-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"voice_ids": "abc123,def456,ghi789"}'
# Response:
# {
# "ok": true,
# "count": 2,
# "imported": [{ "voice_id": "abc123", "ok": true, "name": "Emma" }, ...],
# "failed": [{ "voice_id": "ghi789", "ok": false, "error": "not_found" }]
# }
# Erros: "not_found", "exists_global", "already_imported"
# GET /v1/usage
# { "used_today": 5, "daily_limit": 50, "remaining": 45 }