Preview — Coming Soon

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.

BASE https://api.1ni.in/v1
🎧

1,000 Free Credits on Signup

Every new account gets 1,000 credits to explore any API endpoint. No credit card required. Credits never expire.

Authentication

All requests require a Bearer token in the Authorization header. You'll receive your API key after joining the waitlist and being approved.

HTTP Header
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)

ModelProviderQualityLatencyCostUnit
eleven-turbo-v2.5 ElevenLabs High~300ms 3 creditsper 1K chars
eleven-multilingual-v2 ElevenLabs Ultra~500ms 5 creditsper 1K chars
sarvam-tts-hi Sarvam High~250ms 2 creditsper 1K chars
sarvam-tts-multi Sarvam High~400ms 3 creditsper 1K chars
xtts-v2 Open-weight Good~600ms 1 creditper 1K chars
parler-tts-large Open-weight Good~800ms 1 creditper 1K chars

🔍 Voice Understanding (STT)

ModelProviderFeaturesCostUnit
eleven-scribe-v1 ElevenLabs Transcription + diarization 4 creditsper minute
sarvam-stt-hi Sarvam Hindi/Indic transcription 2 creditsper minute
whisper-large-v3 Open-weight Multilingual transcription 1 creditper minute
whisper-large-v3-turbo Open-weight Fast multilingual 1 creditper minute

🔊 Sound Effects

ModelProviderMax DurationCostUnit
eleven-sfx-v1 ElevenLabs 22s 5 creditsper generation
caps-audiogen Caps AI 30s 3 creditsper generation
audioldm2-large Open-weight 10s 1 creditper generation

🎵 Music Generation

ModelProviderMax DurationCostUnit
caps-musicgen-large Caps AI 60s 8 creditsper generation
musicgen-large Open-weight 30s 3 creditsper generation
musicgen-melody Open-weight 30s 3 creditsper 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.

Model Selection Example
// 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.

POST /v1/tts/generate

Generate speech audio from text input.

Parameters

ParamTypeRequiredDescription
modelstringRequiredModel ID (e.g. eleven-turbo-v2.5)
textstringRequiredText to synthesize (max 5,000 chars)
voicestringRequiredVoice ID or preset name
output_formatstringOptionalmp3_44100, wav, pcm, ogg. Default: mp3_44100
streambooleanOptionalEnable streaming response. Default: false
speedfloatOptionalSpeech speed multiplier (0.5–2.0). Default: 1.0
cURL
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
Python
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.

POST /v1/stt/transcribe

Transcribe an audio file or stream to text.

Python
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.

POST /v1/sfx/generate

Generate a sound effect from a text prompt.

Python
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.

POST /v1/music/generate

Generate music from a text prompt or mood description.

Python
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

CodeStatusDescription
400Bad RequestInvalid parameters or missing required fields
401UnauthorizedMissing or invalid API key
402Payment RequiredInsufficient credits
429Rate LimitedToo many requests — back off and retry
500Server ErrorInternal error — retry with exponential backoff

Rate Limits

PlanRequests/minConcurrentMax Payload
Free20 req/min25 MB
Pro120 req/min1025 MB
EnterpriseCustomCustomCustom

Rate limit headers are included in every response: X-RateLimit-Remaining, X-RateLimit-Reset.