Skip to main content

Server-side Python SDK for the Virturing Voice API

Project description

Virturing Python SDK

Dependency-free synchronous and asynchronous clients for Python 3.10+.

import os
from virturing import Virturing

voice = Virturing(os.environ["VIRTURING_API_KEY"])
call = voice.create_call(
    agent_id="agent_uuid",
    phone_number_id="number_uuid",
    to_number="+94771234567",
    channel="ai",
    metadata={"employee_id": "EMP-1042", "shift": "morning"},
)

To keep an existing Twilio number and carrier account, point its incoming-call webhook to the connector URL shown in Virturing. Start outgoing calls through that connector with:

call = voice.create_twilio_call(
    connector_id="connector_uuid",
    agent_id="agent_uuid",
    to_number="+94771234567",
    metadata={"customer_ref": "CUST-1042"},
    idempotency_key="customer-call-CUST-1042",
)

Twilio continues to bill the carrier leg; Virturing deducts only metered AI/platform usage from the USD wallet.

To use a Virturing number with your own AI or media server, register a WSS endpoint and start a programmable call:

created = voice.create_media_endpoint(
    name="My voice service",
    url="wss://voice.example.com/virturing/media",
)
# Store created["signing_secret"] once in your server-side secret manager.
voice.create_programmable_call(
    phone_number_id="number_uuid",
    media_endpoint_id=created["endpoint"]["id"],
    to_number="+94771234567",
)

verify_media_stream_signature authenticates the WSS opening handshake. The stream uses bidirectional PCM16 mono audio at 8 kHz. See docs/programmable-media.md for the complete contract and customer-hosted Python and Node examples.

The client automatically uses idempotency keys and retries only safe operations. Keep the API key in server-side secrets. verify_webhook_signature validates the exact raw request body before JSON parsing.

Use Virturing(client_id=..., client_secret=..., scopes=[...]) for OAuth client credentials. Access tokens are cached and refreshed automatically. create_media_session(...) creates a metered realtime voice session for a web, desktop, or mobile client.

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

virturing-0.2.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

virturing-0.2.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file virturing-0.2.0.tar.gz.

File metadata

  • Download URL: virturing-0.2.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for virturing-0.2.0.tar.gz
Algorithm Hash digest
SHA256 290f195cc22c1b98ddcb31e99d1a1f89f13ce2049f80218f04293f9610ff774d
MD5 1c678a8ac2bfeaf905da0e3a0694edfc
BLAKE2b-256 e96b2dc9bd96409c2ad5a47c7f9ced150a13a9ba25d3958af90f6454116774f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for virturing-0.2.0.tar.gz:

Publisher: sdk-release.yml on Virturing/virturing_app

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

File details

Details for the file virturing-0.2.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for virturing-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 169f6ef6cc0f9fa4f065aa9128fdf03ab9a9e410144041f4faa194f0cd4ebc5e
MD5 11e838c07763d6a18b176d90e519d2da
BLAKE2b-256 ad52b7ea421242f73cd1dab89d7f90103dcb6e08f7e1d50c158820bacf8d1240

See more details on using hashes here.

Provenance

The following attestation bundles were made for virturing-0.2.0-py3-none-any.whl:

Publisher: sdk-release.yml on Virturing/virturing_app

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