Audra SDKs: npm audra and pip install audra — Audra

There are two official SDKs — npm i audra for Node, pip install audra for Python — plus the zero-install path: the OpenAI SDK pointed at the compat base URL. They are not redundant. The native SDKs speak the v2 wire format (text, format, Idempotency-Key, the jobs API); the OpenAI SDK path is the migration shortcut. This post is the decision guide and the install snippet for each.

npm: the Node client

npm install audra
import { Audra } from "audra";
import { writeFile } from "node:fs/promises";

const audra = new Audra({ apiKey: process.env.AUDRA_API_KEY });

const job = await audra.speech.jobs.create({
  model: "audra-essential",
  voice: "june",
  text: chapterText,            // up to 500k chars
  format: "mp3",
});

const done = await audra.speech.jobs.wait(job.id);   // polls until completed
await writeFile("chapter.mp3", await done.audio());

pip: the Python client

pip install audra
from audra import Audra

audra = Audra(api_key=os.environ["AUDRA_API_KEY"])

resp = audra.speech.create(
    model="audra-essential",
    voice="june",
    text="Chapter one. The river was low that autumn.",
    format="mp3",
    idempotency_key=str(uuid.uuid4()),   # safe retries
)
open("chapter.mp3", "wb").write(resp.audio)

Native SDK vs OpenAI SDK: when each wins

Whatever you pick, keep the key in env and rotate at /dashboard/keys (rotation limited to 5/hour). The Python production checklist — retries, chunking, error classes — is at /blog/python-openai-sdk-audra-tts.