Skip to main content

Python client for Gradium API

Project description

Gradium Python Client

Python client library for the Gradium Voice AI API.

Examples

See the examples/ directory for usage examples:

  • Text-to-Speech Streaming: examples/tts_streaming.py
  • Speech-to-Text Streaming: examples/stt_streaming.py

You can also try it out in Google Colab.

Open In Colab

Command Line Interface

The package includes a CLI that can be run via uvx gradium:

# Text-to-speech
uvx gradium tts "Hello world" -o output.wav
uvx gradium tts "Hello world" --voice-id abc123 -o output.ogg

# Speech-to-text
uvx gradium stt audio.wav
uvx gradium stt audio.wav --json  # outputs JSON with timestamps

# To handle non-wav file, additional dependencies are required
uvx --from 'gradium[cli]' gradium stt audio.mp3

Run uvx gradium --help for all available options.

Text-to-Speech Streaming Example

You can find some examples in the examples/ directory. Try them out with uv. For the text-to-speech streaming example, run:

uv run --with sphn examples/tts_streaming.py \
    --text "Hello, this is a test of the Gradium TTS streaming API." \
    --api-key gsk_...

Speech-to-Text Streaming Example

You can also try the speech-to-text streaming example:

uv run --with sphn examples/stt_streaming.py \
    --audio test_file.mp3 \
    --api-key gsk_...

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

gradium-0.6.2.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

gradium-0.6.2-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file gradium-0.6.2.tar.gz.

File metadata

  • Download URL: gradium-0.6.2.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gradium-0.6.2.tar.gz
Algorithm Hash digest
SHA256 d7de16bdddbfbd041a5e65ca3697d005c3a3eda8d2a87353a9867947cda3c946
MD5 3e381446861b6ea7de163415bf9b20c9
BLAKE2b-256 559b155f07a40957b2074d17e55433618e119f24ce6ce2f682d9ffe3b206b5b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for gradium-0.6.2.tar.gz:

Publisher: CI.yml on gradium-ai/gradium-py

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

File details

Details for the file gradium-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: gradium-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gradium-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f88d1be3a0b34f5dc52d95e2fa0ae6b237f18d7901fd5179c4a12955f59bf35d
MD5 8aff07c00a65aac89f39843fede0138d
BLAKE2b-256 55a46546cb8061ded442ee0b5efcadb55e9291290dad90c5a7d45b24a2c86606

See more details on using hashes here.

Provenance

The following attestation bundles were made for gradium-0.6.2-py3-none-any.whl:

Publisher: CI.yml on gradium-ai/gradium-py

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