Install & Compatibility
Where this runs
tested against v1.7.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 50MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 5.2s · import 0.000s · 50MB
49MB installed
● package 49MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Messages
✓ from vonage_messages import Messages
✗ from vonage import Client
This quickstart demonstrates sending an SMS message using the Vonage Messages API. It initializes the `vonage.Client` (which is extended by `vonage-messages`) and then uses the `client.messages.send` method. Remember to replace placeholder numbers and either set API key/secret as environment variables or directly in the code.
import os
from vonage import Client
VONAGE_API_KEY = os.environ.get('VONAGE_API_KEY', 'YOUR_API_KEY')
VONAGE_API_SECRET = os.environ.get('VONAGE_API_SECRET', 'YOUR_API_SECRET')
if not VONAGE_API_KEY or not VONAGE_API_SECRET:
print("Please set VONAGE_API_KEY and VONAGE_API_SECRET environment variables or replace placeholders.")
else:
client = Client(key=VONAGE_API_KEY, secret=VONAGE_API_SECRET)
try:
response_data = client.messages.send(
{
"channel": "sms",
"to": "YOUR_RECIPIENT_NUMBER", # e.g., "447900000000"
"from": "VONAGE_NUMBER", # Your Vonage virtual number
"text": "Hello from Vonage Python SDK!"
}
)
if response_data["messages"][0]["status"] == "0":
print("Message sent successfully.")
else:
print(f"Message failed with error: {response_data['messages'][0]['error_text']}")
except Exception as e:
print(f"An error occurred: {e}")
Debug
Known issues
gotchaThe `vonage-messages` package is an extension and requires the core `vonage` package to be installed alongside it. Without `vonage`, you will encounter import errors or `AttributeError`.fixEnsure both `pip install vonage` and `pip install vonage-messages` are executed in your environment.
affects: >=1.0.0
breakingThis library is designed for the modern Vonage Messages API, which handles SMS, MMS, and WhatsApp via a unified endpoint. It does not directly support the older, legacy Vonage (formerly Nexmo) SMS API. If you need the legacy SMS API, refer to the `vonage.Sms` client.fixReview the Vonage API documentation to determine if you need the Messages API or the legacy SMS API. For the Messages API, use `client.messages.send()`. For legacy SMS, use `client.sms.send_message()`.
affects: All versions
breakingUsers migrating from the deprecated `nexmo-python` SDK to `vonage-python-sdk` will encounter significant breaking changes, including package renames (`nexmo` to `vonage`), module paths, and method signatures.fixThoroughly review the official Vonage Python SDK migration guide. Update all imports from `nexmo` to `vonage` and adapt API calls to the new `vonage.Client` structure, especially for authentication and message sending.
affects: All versions (relative to `nexmo-python`)
gotchaFor convenience, the `vonage.Client` can automatically pick up `VONAGE_API_KEY` and `VONAGE_API_SECRET` from environment variables. If you pass empty strings or incorrect values, authentication will fail silently until an API call is made.fixAlways verify your `VONAGE_API_KEY` and `VONAGE_API_SECRET` are correctly set as environment variables or explicitly passed to the `Client` constructor with valid credentials. Handle potential `VonageError` exceptions.
affects: All versions
Upgrade
Version history
1.7.1latest on PyPI · released May 29, 2026
Audit
Dependencies
vonagerequiredThe `vonage-messages` library extends the core `vonage.Client` object, so the main `vonage` SDK is a mandatory runtime dependency.