Use an official SDK
Libraries for TypeScript, Python and PHP that cover the whole API, with retries, typed errors and streaming built in.
Install
TypeScript SDK
Node 20 or newer. With Bun, bun add @naiuz/sdk. With Deno, import npm:@naiuz/sdk. It runs on Cloudflare Workers too.
Set your key
Create a key on the dashboard's API keys page, then put it in NEURONAI_API_KEY.
Bash
Every SDK reads the key from there.
Keep the key on your server, and call the API from your backend, never from a page in the browser.
Generate speech
Each tab holds a whole program to save and run. It writes salom.wav and prints how many characters were voiced and what they cost in credits.
TypeScript SDK
Save it as salom.mjs and run node salom.mjs.
Packages and source
| SDK | Package |
|---|---|
| TypeScript SDK | npm @naiuz/sdk |
| Python SDK | PyPI naiuz |
| PHP SDK | Packagist naiuz/sdk |
Each folder holds its SDK's README and api.md, which lists every method.