API Reference

Crikk TTS API

Convert text to speech programmatically. Submit a job, poll for completion, and download the MP3. No SDK required — plain HTTP.

Authentication

All requests must include api_token and user_id in the JSON request body — there are no HTTP headers for auth.

You can generate up to 3 tokens from your Account Settings → API Tokens. Your user_id is also shown there.

Only paid (non-lifetime) plans have API access. Monthly character quota: 2,000,000 characters.

Submit a TTS Job

POST https://crikk.com/generate-audio

Accepts text and a voice name, starts generation asynchronously, and returns a job_id immediately with HTTP 202.

Request body (Content-Type: application/json)

FieldTypeRequiredDescription
api_tokenstringYesYour 12-character API token from Account Settings
user_idnumberYesYour numeric user ID from Account Settings
textstringYesThe text to synthesise — max 12,000 characters
voice_namestringNoVoice short name e.g. en-US-AriaNeural. Defaults to en-US-AriaNeural. See /voice-list.
Request body
{
  "api_token": "aB3dE5fG7hJ9",
  "user_id":   42,
  "text":      "Hello, world!",
  "voice_name": "en-US-GuyNeural"
}
Response 202
{
  "job_id": "a3f8c2e1d4b7...",
  "status": "pending"
}

cURL example

bash
# Submit a TTS job
curl -X POST https://crikk.com/generate-audio \
  -H "Content-Type: application/json" \
  -d '{
    "api_token": "YOUR_TOKEN",
    "user_id": YOUR_USER_ID,
    "text": "Hello, world!",
    "voice_name": "en-US-GuyNeural"
  }'

# → {"job_id":"a3f8c2e1d4b7...","status":"pending"}

Poll Status / Download Audio

GET https://crikk.com/generate-audio/status/:job_id

Poll this endpoint with the job_id from the submit response. When audio is ready, the response body is a raw audio/mpeg binary (MP3). The job is deleted from the server after the audio is downloaded — download once and store it on your side.

HTTP StatusContent-TypeBody
200application/json{"status":"pending"} — still processing
200audio/mpegRaw MP3 binary — audio is ready
404application/jsonJob not found or already downloaded
500application/json{"status":"failed","error":"..."}
bash
# Poll until ready, then save as output.mp3
JOB_ID="a3f8c2e1d4b7..."

while true; do
  STATUS=$(curl -s -o /tmp/audio_response -w "%{content_type}" \
    https://crikk.com/generate-audio/status/$JOB_ID)

  if [[ "$STATUS" == audio/mpeg* ]]; then
    mv /tmp/audio_response output.mp3
    echo "Done! Saved as output.mp3"
    break
  fi

  echo "Still processing..."
  sleep 2
done

List Available Voices

GET https://crikk.com/generate-audio/voice-list

Returns the full list of 322 Microsoft Edge TTS voices. No authentication required. Cached for 24 hours on the client.

Response 200
{
  "count": 322,
  "voices": [
    {
      "name":   "en-US-AriaNeural",
      "locale": "en-US",
      "gender": "Female"
    },
    ...
  ]
}
bash
curl https://crikk.com/generate-audio/voice-list

# Use voice names like:
#   en-US-AriaNeural
#   en-GB-RyanNeural
#   fr-FR-DeniseNeural
#   ja-JP-NanamiNeural

Error Reference

Statuserror fieldMeaning
400Missing required fieldsOne or more required body fields are absent
400Text exceeds 12,000 characters limittext is too long
401Invalid API tokenThe api_token / user_id combination is not valid
403API access not availableYour plan does not include API access
404Job not foundThe job_id does not exist or audio was already downloaded
429Monthly character limit exceededYou have used your 2,000,000 monthly character quota
500Generation failedTTS synthesis error — retry with the same parameters

Quick Start (JavaScript)

A complete, self-contained example that submits text, polls for completion, and saves the MP3.

JavaScript (Node.js / browser)
const API_TOKEN = "YOUR_TOKEN";
const USER_ID   = YOUR_USER_ID;     // numeric
const BASE_URL  = "https://crikk.com";

async function textToSpeech(text, voiceName = "en-US-AriaNeural") {
  // 1. Submit job
  const submitRes = await fetch(`${BASE_URL}/generate-audio`, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      api_token:  API_TOKEN,
      user_id:    USER_ID,
      text,
      voice_name: voiceName,
    }),
  });

  if (!submitRes.ok) {
    const err = await submitRes.json();
    throw new Error(err.error ?? "Submit failed");
  }

  const { job_id } = await submitRes.json();
  console.log("Job submitted:", job_id);

  // 2. Poll until done
  while (true) {
    await new Promise(r => setTimeout(r, 1500));

    const pollRes = await fetch(
      `${BASE_URL}/generate-audio/status/${job_id}`
    );

    if (pollRes.headers.get("content-type")?.startsWith("audio/mpeg")) {
      return pollRes.blob(); // ← MP3
    }

    const data = await pollRes.json();
    if (data.status === "failed") throw new Error(data.error ?? "Generation failed");
    console.log("Status:", data.status);
  }
}

// Usage
textToSpeech("Hello from Crikk API!", "en-US-GuyNeural")
  .then(blob => {
    const url = URL.createObjectURL(blob);
    const a   = document.createElement("a");
    a.href = url; a.download = "speech.mp3"; a.click();
  })
  .catch(console.error);

Ready to build?

Generate your API token in Account Settings — it takes 10 seconds.

Go to Account Settings