Skip to main content

DhivehiGPT SDK for Python

Welcome to the DhivehiGPT SDK for Python documentation. This package provides a lightweight, zero-dependency Python client for the DhivehiGPT API.

Key Features

  • Zero runtime dependencies: built entirely on the Python standard library, so it stays small and easy to vendor into any project.
  • Simple, resource-based API: client.voices, client.tts, client.balance, and client.tasks mirror the DhivehiGPT API's structure directly.
  • Automatic API key loading: reads DHIVEHIGPT_API_KEY from the environment by default.
  • Typed exceptions: every error response is raised as a specific, catchable exception (AuthenticationError, NotFoundError, ValidationError, RateLimitError, and more).
  • Configurable server: override the base URL and API version for testing or self-hosted proxies.

Quick Example

from dhivehigpt_sdk import DhivehiGPT

client = DhivehiGPT() # reads DHIVEHIGPT_API_KEY from the environment

audio = client.tts.generate(text="ދިވެހިޖީޕީޓީއަށް މަރުޙަބާ", voice="hajja")
print(audio["data"]["audio_url"])

Next Steps

Ready to get started?

  1. Head over to Installation & Setup to add the package to your project.
  2. Read Authentication to learn how to generate an API key.
  3. Explore Usage to see every resource the SDK exposes.