Skip to content

SDKs

Official client libraries for Python, JavaScript/TypeScript, and Go.

Python

Requires Python 3.8+. Supports both sync and async usage.

1pip install nur-ai
1from nur import NurClient
2
3client = NurClient()
4
5# Text to Speech
6audio = client.tts.generate(
7 text="Hello from Python!",
8 voice_id="rachel_v2"
9)
10audio.save("output.mp3")
11
12# Speech to Text
13transcript = client.stt.transcribe(file="audio.mp3")
14print(transcript.text)
15
16# Async usage
17import asyncio
18
19async def main():
20 async with client.stt.stream(language="en") as stream:
21 async for result in stream:
22 print(result.text)
23
24asyncio.run(main())

JavaScript / TypeScript

Works with Node.js 18+, Deno, and Bun. Full TypeScript types included.

1npm install @nur/sdk
1import { NurClient } from '@nur/sdk';
2
3const client = new NurClient();
4
5// Text to Speech
6const audio = await client.tts.generate({
7 text: 'Hello from JavaScript!',
8 voiceId: 'rachel_v2',
9});
10await audio.save('output.mp3');
11
12// Speech to Text
13const transcript = await client.stt.transcribe({
14 file: 'audio.mp3',
15});
16console.log(transcript.text);
17
18// Streaming
19const stream = await client.tts.stream({
20 text: 'Streaming audio...',
21 voiceId: 'rachel_v2',
22});
23
24for await (const chunk of stream) {
25 process.stdout.write(chunk);
26}

Go

Requires Go 1.21+. Fully idiomatic with context support.

1go get github.com/nur-ai/nur-go
1package main
2
3import (
4 "context"
5 "fmt"
6 nur "github.com/nur-ai/nur-go"
7)
8
9func main() {
10 client := nur.NewClient()
11
12 // Text to Speech
13 audio, _ := client.TTS.Generate(context.Background(), &nur.TTSRequest{
14 Text: "Hello from Go!",
15 VoiceID: "rachel_v2",
16 })
17 audio.Save("output.mp3")
18
19 // Speech to Text
20 transcript, _ := client.STT.Transcribe(context.Background(), &nur.STTRequest{
21 File: "audio.mp3",
22 })
23 fmt.Println(transcript.Text)
24}

Configuration

All SDKs support the following configuration options:

OptionEnv VariableDefaultDescription
api_keyNUR_API_KEY-Your API key
base_urlNUR_BASE_URLhttps://api.nur.aiAPI base URL
timeoutNUR_TIMEOUT30sRequest timeout
max_retriesNUR_MAX_RETRIES3Max retry attempts for failed requests

Error Handling

All SDKs throw typed errors that you can catch and handle.

1from nur import NurClient, NurError, RateLimitError
2
3client = NurClient()
4
5try:
6 audio = client.tts.generate(text="Hello", voice_id="rachel_v2")
7except RateLimitError as e:
8 print(f"Rate limited. Retry after {e.retry_after}s")
9except NurError as e:
10 print(f"API error {e.status_code}: {e.message}")