Skip to main content

Python client for Gnani's Vachana speech AI platform (STT, TTS, and more)

Project description

gnani-vachana

License: MIT

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

gnani_vachana-0.1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gnani_vachana-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file gnani_vachana-0.1.0.tar.gz.

File metadata

  • Download URL: gnani_vachana-0.1.0.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

Hashes for gnani_vachana-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cae8237e10ef40db0d61b2644624a4d88a3e0478f7408eb909798444e0a81eb7
MD5 a28ae6f91cafdad5862d691c3ee73f29
BLAKE2b-256 b30cc7240b62b75d6fe0486d51669cdfedb4cc98bb39c067cf96dcf63af1616e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gnani_vachana-0.1.0.tar.gz:

Publisher: workflow.yml on Gnani-AI-Mintlify/Gnani-Vachana

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gnani_vachana-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gnani_vachana-0.1.0-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

Hashes for gnani_vachana-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4cfb45e279163a904fc58452bb2bafbb8c2714ef41686b9c7269696bc060e6c4
MD5 9221baec347c0c57536628156ee2bece
BLAKE2b-256 b756e9cf785118b3cc91a25cc3cc82394997177776ff1607a91b7b76cf1256d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for gnani_vachana-0.1.0-py3-none-any.whl:

Publisher: workflow.yml on Gnani-AI-Mintlify/Gnani-Vachana

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page