Skip to main content

Official Dial SDK — phone numbers, SMS, WhatsApp, and voice calls for AI agents

Project description

dial-sdk

Official Python SDK for Dial — phone numbers, SMS, WhatsApp, and voice calls for AI agents.

Install

pip install dial-sdk
# or
uv add dial-sdk

Requires Python 3.11+.

Quickstart

The client is async. Construct it with a DialConfig, then call its methods inside an async with block:

import asyncio
from dial_sdk import DialClient, DialConfig, SendMessageParams, MakeCallParams

async def main():
    async with DialClient(DialConfig(api_key="sk_live_...")) as dial:
        # List your numbers
        numbers = await dial.list_numbers()
        from_id = numbers[0].id

        # Send an SMS
        await dial.send_message(SendMessageParams(
            to="+15551234567",
            from_number_id=from_id,
            body="Hello from Dial",
        ))

        # Place an AI voice call
        call = await dial.make_call(MakeCallParams(
            to="+15551234567",
            from_number_id=from_id,
            outbound_instruction="You are a friendly assistant confirming an appointment.",
        ))
        print(call.id, call.status)

asyncio.run(main())

DialConfig.base_url defaults to https://api.getdial.ai. Override it for local or self-hosted setups.

Live events

Incoming messages and call transcripts stream via an async generator:

async with DialClient(DialConfig(api_key="sk_live_...")) as dial:
    async with dial.new_events_connection() as events:
        async for event in events:
            print(event)  # MessageEvent / CallEvent / CallTranscribed / ...

Client methods

Method Description
list_numbers() List the phone numbers on your account
purchase_number(params) Buy a new number (PurchaseNumberParams)
set_number_properties(...) Update a number's nickname / inbound instruction
send_message(params) Send an SMS or WhatsApp message (SendMessageParams)
reply_to_message(message_id, *, body=None, reaction=None) Reply or react to a message (exactly one of body/reaction)
list_messages(...) List messages, optionally filtered
make_call(params) Place an outbound AI voice call (MakeCallParams)
list_calls(...) List calls, optionally filtered
get_call(call_id) Fetch a single call
new_events_connection() Open a live event stream

Related

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

dial_sdk-0.19.0.tar.gz (102.2 kB view details)

Uploaded Source

Built Distribution

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

dial_sdk-0.19.0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file dial_sdk-0.19.0.tar.gz.

File metadata

  • Download URL: dial_sdk-0.19.0.tar.gz
  • Upload date:
  • Size: 102.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for dial_sdk-0.19.0.tar.gz
Algorithm Hash digest
SHA256 bcfca4662e26db3b9c4831b9e9c5faebb97871b828a6b2ec3c8af3ceafe55e83
MD5 2269af38929eeff152027d196fa6a8e0
BLAKE2b-256 bcc57f42adc811d2e377a60df36718c37c8e9b3ed8bab659706d91c73ed3cb32

See more details on using hashes here.

Provenance

The following attestation bundles were made for dial_sdk-0.19.0.tar.gz:

Publisher: publish-sdk-python.yml on GENWAY-AI/dial

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

File details

Details for the file dial_sdk-0.19.0-py3-none-any.whl.

File metadata

  • Download URL: dial_sdk-0.19.0-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for dial_sdk-0.19.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3aa06d7c168fbfc3d60b500449d9db9b0e6110f0bdc99dfccd1dc3f9af38f574
MD5 e319db54aad13f8d5c89139c94d41d0d
BLAKE2b-256 9b71da7e2dda5d734e6b71bc8254c7fc2090c9444d712a544bec99b786d05090

See more details on using hashes here.

Provenance

The following attestation bundles were made for dial_sdk-0.19.0-py3-none-any.whl:

Publisher: publish-sdk-python.yml on GENWAY-AI/dial

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