Vonage

4.7.2 · active · verified Sun Mar 01

Official Python SDK for Vonage APIs (formerly Nexmo) — SMS, Voice, WhatsApp, Verify, Video. v4.0 (2023) is a complete architectural rewrite from v3. Old nexmo package and old vonage v3 patterns are entirely broken in v4. Now a monorepo: top-level vonage package plus separate vonage_sms, vonage_voice, vonage_verify etc. packages installed as dependencies. All responses are Pydantic models.

Warnings

Install

Imports

Quickstart

SMS uses API key/secret auth. Voice and Video require JWT auth via application_id + private_key. Responses are Pydantic models — use .model_dump_json() or access attributes directly.

import os
from vonage import Vonage, Auth
from vonage_sms import SmsMessage

auth = Auth(
    api_key=os.environ['VONAGE_API_KEY'],
    api_secret=os.environ['VONAGE_API_SECRET']
)
client = Vonage(auth=auth)

message = SmsMessage(
    to='15551234567',
    from_='Vonage',
    text='Hello from Vonage!'
)

response = client.sms.send(message)
print(response.model_dump_json(exclude_unset=True))

# For Voice/JWT auth, use:
# auth = Auth(application_id='APP_ID', private_key='path/to/private.key')

view raw JSON →