Python client for Gnani's Vachana speech AI platform (STT, TTS, and more)
Project description
gnani-vachana
Official Python client for the Vachana Speech-to-Text API by Gnani.ai. Transcribe audio in 10 Indian languages with a single function call.
Vachana is a production-ready speech-to-text API with automatic language detection and code-switching support for accurate multilingual transcriptions.
Installation
pip install gnani-vachana
Requires Python 3.9+.
Quick Start
from gnani_stt import GnaniSTTClient
client = GnaniSTTClient(
organization_id="your-organization-id",
api_key="your-api-key",
user_id="your-user-id",
)
result = client.transcribe("audio.wav", language_code="hi-IN")
print(result["transcript"])
Authentication
The Vachana API uses header-based authentication. Every request requires three credentials:
| Parameter | Header | Description |
|---|---|---|
organization_id |
X-Organization-ID |
Your organisation identifier |
api_key |
X-API-Key-ID |
Secret key for authentication |
user_id |
X-API-User-ID |
Your user / organisation name |
Obtaining Credentials
Email speechstack@gnani.ai with your name, company, and use case. Credentials are typically provisioned within 1 business day, and all new accounts receive free credits -- no credit card required.
Passing Credentials
Option 1 -- Constructor arguments:
client = GnaniSTTClient(
organization_id="your-organization-id",
api_key="your-api-key",
user_id="your-user-id",
)
Option 2 -- Environment variables:
export GNANI_ORGANIZATION_ID="your-organization-id"
export GNANI_API_KEY="your-api-key"
export GNANI_USER_ID="your-user-id"
client = GnaniSTTClient()
Supported Languages
| Language | Code | Native Script |
|---|---|---|
| Bengali | bn-IN |
বাংলা |
| English (India) | en-IN |
Latin |
| Gujarati | gu-IN |
ગુજરાતી |
| Hindi | hi-IN |
हिन्दी |
| Kannada | kn-IN |
ಕನ್ನಡ |
| Malayalam | ml-IN |
മലയാളം |
| Marathi | mr-IN |
मराठी |
| Punjabi | pa-IN |
ਪੰਜਾਬੀ |
| Tamil | ta-IN |
தமிழ் |
| Telugu | te-IN |
తెలుగు |
For multilingual / code-switching audio (e.g. Hindi-English mix), pass a comma-separated code:
result = client.transcribe("meeting.wav", language_code="en-IN,hi-IN")
Usage
Transcribe a file by path
result = client.transcribe("meeting.wav", language_code="en-IN")
print(result["transcript"])
Transcribe from a file object
with open("meeting.mp3", "rb") as f:
result = client.transcribe(f, language_code="ta-IN")
Transcribe raw bytes
audio_bytes = download_audio_from_somewhere()
result = client.transcribe_bytes(
audio_bytes, filename="clip.wav", language_code="kn-IN"
)
Custom request ID
result = client.transcribe(
"call.flac", language_code="hi-IN", request_id="my-trace-123"
)
List supported languages
for code, name in GnaniSTTClient.supported_languages().items():
print(f"{code}: {name}")
Audio Requirements
| Constraint | Value |
|---|---|
| Formats | WAV, MP3, FLAC, OGG, M4A |
| Max duration | 60 seconds |
| Channels | Mono or stereo |
| Sample rate | Automatically converted to 16 kHz mono |
Response Format
{
"success": true,
"request_id": "req_abc123",
"timestamp": "20251226_143052.123",
"transcript": "नमस्ते, आप कैसे हैं?"
}
Error Handling
from gnani_stt import AuthenticationError, InvalidAudioError, APIError
try:
result = client.transcribe("audio.wav", language_code="hi-IN")
except AuthenticationError:
print("Check your credentials")
except InvalidAudioError as e:
print(f"Bad audio file: {e}")
except APIError as e:
print(f"API error {e.status_code}: {e}")
Documentation
Full API reference and guides are available at docs.inya.ai/vachana.
License
This project is licensed under the MIT License -- see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gnani_vachana-0.1.1.tar.gz.
File metadata
- Download URL: gnani_vachana-0.1.1.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f58ece69bf9fc84d287155412f8d1ce13258d56844687e221828ba0e2619476a
|
|
| MD5 |
2b10d603d416515bde4fdc22b829588c
|
|
| BLAKE2b-256 |
217602aaba248716fcbabe17e33906be012ea440ac88dbcf8b8a741029d136d8
|
Provenance
The following attestation bundles were made for gnani_vachana-0.1.1.tar.gz:
Publisher:
workflow.yml on Gnani-AI-Mintlify/Gnani-Vachana
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gnani_vachana-0.1.1.tar.gz -
Subject digest:
f58ece69bf9fc84d287155412f8d1ce13258d56844687e221828ba0e2619476a - Sigstore transparency entry: 1065344854
- Sigstore integration time:
-
Permalink:
Gnani-AI-Mintlify/Gnani-Vachana@a6860e4f323b3064bc562763b42fbad7ae9eb334 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Gnani-AI-Mintlify
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@a6860e4f323b3064bc562763b42fbad7ae9eb334 -
Trigger Event:
release
-
Statement type:
File details
Details for the file gnani_vachana-0.1.1-py3-none-any.whl.
File metadata
- Download URL: gnani_vachana-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb244d7e69dfe1937892bd9b1de9b4d690805efcc90e33d2e8e7bdb9258d948c
|
|
| MD5 |
10fdb34babf680c252ee168142c3a8ee
|
|
| BLAKE2b-256 |
cf50dc054501aaf6828a875d08e8e2fa027cb76c4d96e146e66b136cd5fb794f
|
Provenance
The following attestation bundles were made for gnani_vachana-0.1.1-py3-none-any.whl:
Publisher:
workflow.yml on Gnani-AI-Mintlify/Gnani-Vachana
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gnani_vachana-0.1.1-py3-none-any.whl -
Subject digest:
cb244d7e69dfe1937892bd9b1de9b4d690805efcc90e33d2e8e7bdb9258d948c - Sigstore transparency entry: 1065344860
- Sigstore integration time:
-
Permalink:
Gnani-AI-Mintlify/Gnani-Vachana@a6860e4f323b3064bc562763b42fbad7ae9eb334 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Gnani-AI-Mintlify
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@a6860e4f323b3064bc562763b42fbad7ae9eb334 -
Trigger Event:
release
-
Statement type: