API Documentation
Everything you need to integrate AI-powered audio into your product. One unified API, multiple world-class models. 1,000 free credits on signup.
Overview
The 1ni.in API provides unified access to state-of-the-art audio AI models through a single REST API. Generate natural-sounding speech, transcribe audio, create sound effects, and compose music — all with one API key.
Authentication
All requests require a Bearer token in the Authorization header. You'll receive your API key after joining the waitlist and being approved.
Authorization: Bearer YOUR_API_KEY
Credits & Pricing
1ni.in uses a simple credit-based system. Different models consume different amounts of credits depending on quality, speed, and the underlying provider. All plans include free credits to get started.
Credit Costs by Category
🎙 Voice Generation (TTS)
| Model | Provider | Quality | Latency | Cost | Unit |
|---|---|---|---|---|---|
| eleven-turbo-v2.5 | ElevenLabs | High | ~300ms | 3 credits | per 1K chars |
| eleven-multilingual-v2 | ElevenLabs | Ultra | ~500ms | 5 credits | per 1K chars |
| sarvam-tts-hi | Sarvam | High | ~250ms | 2 credits | per 1K chars |
| sarvam-tts-multi | Sarvam | High | ~400ms | 3 credits | per 1K chars |
| xtts-v2 | Open-weight | Good | ~600ms | 1 credit | per 1K chars |
| parler-tts-large | Open-weight | Good | ~800ms | 1 credit | per 1K chars |
🔍 Voice Understanding (STT)
| Model | Provider | Features | Cost | Unit |
|---|---|---|---|---|
| eleven-scribe-v1 | ElevenLabs | Transcription + diarization | 4 credits | per minute |
| sarvam-stt-hi | Sarvam | Hindi/Indic transcription | 2 credits | per minute |
| whisper-large-v3 | Open-weight | Multilingual transcription | 1 credit | per minute |
| whisper-large-v3-turbo | Open-weight | Fast multilingual | 1 credit | per minute |
🔊 Sound Effects
| Model | Provider | Max Duration | Cost | Unit |
|---|---|---|---|---|
| eleven-sfx-v1 | ElevenLabs | 22s | 5 credits | per generation |
| caps-audiogen | Caps AI | 30s | 3 credits | per generation |
| audioldm2-large | Open-weight | 10s | 1 credit | per generation |
🎵 Music Generation
| Model | Provider | Max Duration | Cost | Unit |
|---|---|---|---|---|
| caps-musicgen-large | Caps AI | 60s | 8 credits | per generation |
| musicgen-large | Open-weight | 30s | 3 credits | per generation |
| musicgen-melody | Open-weight | 30s | 3 credits | per generation |
Model Selection
Every endpoint accepts a model parameter. Choose the right model for your use case based on quality, latency, language support, and cost. You can switch models per-request — no configuration needed.
// Use ElevenLabs for premium English TTS { "model": "eleven-turbo-v2.5", "text": "Welcome to the future of audio.", "voice": "aria" } // Use Sarvam for Hindi TTS at lower cost { "model": "sarvam-tts-hi", "text": "ऑडियो AI का भविष्य यहाँ है।", "voice": "meera" } // Use open-weight for cost-effective bulk processing { "model": "xtts-v2", "text": "Process thousands of lines affordably.", "voice": "default-en" }
Voice Generation
Convert text to natural-sounding speech. Supports voice cloning, SSML, streaming, and multilingual synthesis.
Generate speech audio from text input.
Parameters
| Param | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Model ID (e.g. eleven-turbo-v2.5) |
| text | string | Required | Text to synthesize (max 5,000 chars) |
| voice | string | Required | Voice ID or preset name |
| output_format | string | Optional | mp3_44100, wav, pcm, ogg. Default: mp3_44100 |
| stream | boolean | Optional | Enable streaming response. Default: false |
| speed | float | Optional | Speech speed multiplier (0.5–2.0). Default: 1.0 |
curl -X POST https://api.1ni.in/v1/tts/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "eleven-turbo-v2.5", "text": "Hello, welcome to one-ni audio AI.", "voice": "aria", "output_format": "mp3_44100", "stream": false }' \ --output output.mp3
import requests response = requests.post( "https://api.1ni.in/v1/tts/generate", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={ "model": "eleven-turbo-v2.5", "text": "Hello from 1ni.in!", "voice": "aria", "output_format": "mp3_44100" } ) with open("output.mp3", "wb") as f: f.write(response.content)
Voice Understanding
Transcribe audio to text with optional speaker diarization, emotion detection, and language identification.
Transcribe an audio file or stream to text.
response = requests.post( "https://api.1ni.in/v1/stt/transcribe", headers={"Authorization": "Bearer YOUR_API_KEY"}, files={"audio": open("recording.mp3", "rb")}, data={ "model": "whisper-large-v3", "diarize": "true", "language": "en" } ) result = response.json() print(result["text"]) # "Hello, this is speaker one. And this is speaker two."
Sound Effects
Generate custom sound effects from natural language descriptions. Ideal for games, videos, and immersive experiences.
Generate a sound effect from a text prompt.
response = requests.post( "https://api.1ni.in/v1/sfx/generate", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={ "model": "eleven-sfx-v1", "prompt": "Thunder rumbling in the distance with light rain", "duration": 10 } )
Music Generation
Create original music from text descriptions, moods, or reference audio. Get full mixes or individual stems.
Generate music from a text prompt or mood description.
response = requests.post( "https://api.1ni.in/v1/music/generate", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={ "model": "musicgen-large", "prompt": "Upbeat lo-fi hip hop with warm piano and vinyl crackle", "duration": 30, "output_format": "wav" } )
Error Codes
| Code | Status | Description |
|---|---|---|
| 400 | Bad Request | Invalid parameters or missing required fields |
| 401 | Unauthorized | Missing or invalid API key |
| 402 | Payment Required | Insufficient credits |
| 429 | Rate Limited | Too many requests — back off and retry |
| 500 | Server Error | Internal error — retry with exponential backoff |
Rate Limits
| Plan | Requests/min | Concurrent | Max Payload |
|---|---|---|---|
| Free | 20 req/min | 2 | 5 MB |
| Pro | 120 req/min | 10 | 25 MB |
| Enterprise | Custom | Custom | Custom |
Rate limit headers are included in every response: X-RateLimit-Remaining, X-RateLimit-Reset.