Skip to main content

Install

Python 3.9 or later. The package is namu-ai; you import namu. Then set your key:

Quickstart

Usage

Text to speech

format is wav (default), mp3 or opus. See text to speech.
The key needs the converse scope.

Errors

Every error is a NamuError; errors the API answered carry its stable type, the status, a message and the request_id. Each status has its own class:

Retries and timeouts

The client retries network errors, 429 rate_limited and 502/503/504 up to 3 times, waiting Retry-After or 1, 2, then 4 seconds. It never retries quota_exceeded or other 4xx. The default timeout is 300 seconds, because the first request after a quiet spell is slower.

In a web app

Keep the client on the server. With Flask, a route that speaks text for your app:

Configuration

Responses are dictionaries typed with TypedDict (namu.types), so your editor completes their fields.

Source

The library is open source (Apache 2.0): github.com/namu-ai-lab/namu-sdks. Changes are listed in its changelog.