Developer Guide

Getting Started with the Australian Transcription API

One script, one audio file, one transcript with speaker labels. Copy the Python or Node.js version below, add your API key and run it.

The REST API behind Australian Transcription takes an audio file and returns a transcript plus a speaker-labelled version of it. It runs in our Sydney datacentre and costs $0.02 AUD per audio minute, with speaker diarization included.

What you need

  • Python 3.8+ or Node.js 18+
  • An API key: sign up free and you get 90 minutes of audio with no credit card
  • An audio file (MP3, WAV, OGG, FLAC, M4A, MP4, or WebM, up to 200 MB)

How the API works

Submit a file to POST /api/v1/transcribe and you get a job_id straight back. Poll GET /api/v1/jobs/{job_id} until the status is completed. In AEST business hours a typical file is done in under 2 minutes. Outside them the backend scales to zero and a cold start adds 5 to 15 minutes, which is why both samples poll for 20.

That first completed response is the only one that carries the transcript. The files are deleted after it and later polls return null, so both samples write the result to disk straight away.

Python quickstart

Install the only dependency you need:

shell
pip install requests

Then submit a file and poll for the result:

transcribe.py
import time
import requests

API_KEY = "sk_your_api_key_here"
BASE_URL = "https://api.icana.ai/api/v1"
HEADERS = {"X-API-Key": API_KEY}

# 1. Submit the audio file
with open("audio.mp3", "rb") as f:
    resp = requests.post(
        f"{BASE_URL}/transcribe",
        headers=HEADERS,
        files={"file": f},
        data={"language": "en"},
    )
resp.raise_for_status()

data = resp.json()
job_id = data["job_id"]
print(f"Job submitted: {job_id}")
print(f"Status: {data['status']}")  # "processing" or "pending"

# 2. Poll every 10 s for up to 20 minutes (a cold start adds 5-15 min)
for _ in range(120):
    result = requests.get(f"{BASE_URL}/jobs/{job_id}", headers=HEADERS).json()
    status = result["status"]
    print(f"Status: {status}")

    if status == "completed":
        # The transcript is only returned in this response, so save it now.
        with open("transcript.txt", "w") as out:
            out.write(result["transcription"])
        print("\nTranscription:")
        print(result["transcription"])
        print("\nSpeaker diarization:")
        print(result["diarization"])
        break
    elif status == "failed":
        raise RuntimeError(f"Transcription failed: {result['error_message']}")

    time.sleep(10)
else:
    raise TimeoutError(f"Job {job_id} did not complete within 20 minutes")

Node.js quickstart

No packages to install: Node.js 18+ has fetch, FormData and Blob built in.

transcribe.js
const fs = require("fs");
const path = require("path");

const API_KEY = "sk_your_api_key_here";
const BASE_URL = "https://api.icana.ai/api/v1";

async function transcribe(filePath) {
  const form = new FormData();
  // The filename matters: the API checks the file extension.
  form.append("file", new Blob([fs.readFileSync(filePath)]), path.basename(filePath));
  form.append("language", "en");

  const res = await fetch(`${BASE_URL}/transcribe`, {
    method: "POST",
    headers: { "X-API-Key": API_KEY },
    body: form,
  });
  if (!res.ok) throw new Error(`Submit failed: ${res.status} ${await res.text()}`);

  const { job_id, status } = await res.json();
  console.log(`Job submitted: ${job_id} (${status})`);

  // Poll every 10 s for up to 20 minutes (a cold start adds 5-15 min)
  for (let attempt = 0; attempt < 120; attempt++) {
    await new Promise((r) => setTimeout(r, 10000));

    const result = await fetch(`${BASE_URL}/jobs/${job_id}`, {
      headers: { "X-API-Key": API_KEY },
    }).then((r) => r.json());

    if (result.status === "completed") {
      // The transcript is only returned in this response, so keep it.
      return result;
    }
    if (result.status === "failed") {
      throw new Error(`Transcription failed: ${result.error_message}`);
    }

    console.log("Status:", result.status);
  }
  throw new Error(`Job ${job_id} did not complete within 20 minutes`);
}

transcribe("audio.mp3").then((result) => {
  fs.writeFileSync("transcript.txt", result.transcription);
  console.log("Transcription:", result.transcription);
  console.log("Diarization:", result.diarization);
});

Speaker labels and vocabulary hints

Two optional form fields make the biggest difference to output quality. num_speakers (1 to 10, default 2) is the most speakers the diarization will label; set it to the number of people who speak. prompt takes a comma-separated list of names and terms the model would otherwise misspell; only the last ~200 tokens (about 40 to 60 words) are used.

python
resp = requests.post(
    f"{BASE_URL}/transcribe",
    headers=HEADERS,
    files={"file": open("meeting.mp3", "rb")},
    data={
        "language": "en",
        "num_speakers": 3,
        "prompt": "ACME Corp, Dr. Nguyen, KPIs, Q3 review, CRM",
    },
)

The diarization field in the completed job is a string with one line per segment:

output
SPEAKER_00 [00:00:00.000 - 00:00:02.310]: Hello, thanks for joining the call.
SPEAKER_01 [00:00:02.800 - 00:00:03.900]: Happy to be here.
SPEAKER_00 [00:00:04.200 - 00:00:05.150]: Let's get started.
SPEAKER_02 [00:00:05.600 - 00:00:07.420]: Quick question before we do...

Next steps

POST /api/v1/transcribe allows 10 requests a minute per API key and every other endpoint allows 60; over the limit you get a 429 with a Retry-After header. Before you put this into production, read Convert Speech to Text in Python. It covers retries for 429 and 402 responses, polling with backoff, parallel batches and checking your credit balance. Every endpoint and field is in the API documentation.

Frequently asked questions

What is the Australian Transcription API?

It's the REST API behind Australian Transcription, the same transcription service that runs the web playground. Jobs you start in the playground email you the transcript when they finish; jobs you start through the API return it in the poll response.

Do I need an SDK?

No. Any HTTP client that can send a multipart form upload works. The Python sample needs only requests, and the Node.js sample uses the fetch, FormData and Blob built into Node 18.

What does it cost?

$0.02 AUD per audio minute, which is $1.20 AUD per audio hour, with speaker diarization included. New accounts get 90 minutes free and don't need a credit card.

How do I get speaker labels in my transcript?

You already have them: every completed job returns a diarization field. Set num_speakers when the recording has more or fewer than two people. The labels are anonymous (SPEAKER_00, SPEAKER_01), so you map them to names yourself.

What happens to my audio after transcription?

It's processed in our Sydney datacentre and is not sent overseas. Audio and transcript files are deleted once the completed result is delivered. If your code stops polling, a background job finalises the transcription within about 30 minutes, emails you the transcript and deletes the files.

Get your free API key

The key is the only thing missing from the scripts above. Sign up without a credit card and your first 90 minutes of audio are on us.