Skip to content

Authentication

Learn how to authenticate your requests to the Nur API.

API Keys

All API requests require authentication using a Bearer token. You can generate API keys from the Nur Dashboard. Each key begins with the prefix nur_.

1Authorization: Bearer nur_your_api_key_here

Using the SDK

The SDKs automatically read from the NUR_API_KEY environment variable, or you can pass the key explicitly.

1from nur import NurClient
2
3# Option 1: Auto-reads NUR_API_KEY env var
4client = NurClient()
5
6# Option 2: Explicit API key
7client = NurClient(api_key="nur_your_api_key_here")

Key Scopes

API keys can be scoped to specific products and permissions. Use restricted keys in production to follow the principle of least privilege.

ScopeAccessDescription
tts:readText to SpeechGenerate speech from text
tts:writeText to SpeechGenerate speech + manage voice settings
stt:readSpeech to TextTranscribe audio files and streams
voices:readVoicesList and retrieve voice information
voices:writeVoicesClone, update, and delete voices
agents:readVoice AgentsList and retrieve agents
agents:writeVoice AgentsCreate, update, and delete agents
dubbing:writeAI DubbingCreate and manage dubbing jobs
music:writeMusic GenerationGenerate and manage music tracks
audio:writeAudio ToolsDenoise and enhance audio files
*AllFull access to all endpoints

Security Best Practices

Never expose keys in client-side code

API keys should only be used on the server. Use a backend proxy for browser-based apps.

Use environment variables

Store keys in environment variables, never hard-code them in source files.

Rotate keys regularly

Generate new keys periodically and revoke old ones from the Dashboard.

Use scoped keys in production

Create keys with minimum required scopes for each service or deployment.

Monitor usage

Check the Dashboard for unusual API usage patterns that might indicate a leaked key.

Authentication Errors

If authentication fails, the API returns one of these errors:

1{
2 "error": {
3 "code": "unauthorized",
4 "message": "Missing Authorization header."
5 }
6}