{"id":9390,"library":"vonage-account","title":"Vonage Account API Client","description":"The `vonage-account` library provides Python bindings for interacting with the Vonage Account API. It is part of the larger Vonage Python SDK monorepo (version 4.x.x+), offering functionalities to manage account-related operations such as retrieving balance information. The SDK aims for a regular release cadence, with the main `vonage` package seeing frequent updates.","status":"active","version":"1.1.1","language":"en","source_language":"en","source_url":"https://github.com/Vonage/vonage-python-sdk","tags":["vonage","api","account","sdk","telecom"],"install":[{"cmd":"pip install vonage-account","lang":"bash","label":"Install vonage-account standalone"},{"cmd":"pip install vonage","lang":"bash","label":"Install full Vonage SDK (recommended)"}],"dependencies":[{"reason":"The `vonage-account` package is typically used as part of the main `vonage` SDK, which handles client instantiation and authentication. Installing `vonage` automatically pulls in `vonage-account` and other API-specific sub-packages.","package":"vonage"}],"imports":[{"note":"While `vonage-account` is a distinct package, the recommended way to access its functionality is through the main `vonage.Vonage` client instance, which exposes API-specific clients as properties (e.g., `client.account`). Direct import of an `AccountClient` class from `vonage_account` is not the standard pattern shown in documentation for recent SDK versions.","wrong":"import vonage_account.AccountClient","symbol":"Vonage","correct":"from vonage import Vonage, Auth"}],"quickstart":{"code":"import os\nfrom vonage import Vonage, Auth\n\n# Initialize Vonage client using API key and secret from environment variables\n# VONAGE_API_KEY and VONAGE_API_SECRET\nclient = Vonage(\n    auth=Auth(\n        api_key=os.environ.get('VONAGE_API_KEY', 'YOUR_API_KEY'),\n        api_secret=os.environ.get('VONAGE_API_SECRET', 'YOUR_API_SECRET')\n    )\n)\n\ntry:\n    # Retrieve account balance\n    balance_response = client.account.get_balance()\n    print(f\"Account Balance: {balance_response['value']} {balance_response['unit']}\")\n\n    # Get account top-up status (example of another account method)\n    topup_response = client.account.get_topup()\n    print(f\"Account Auto Top-up: {'Enabled' if topup_response.get('auto_topup') else 'Disabled'}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure VONAGE_API_KEY and VONAGE_API_SECRET are correctly set and have permissions.\")","lang":"python","description":"This quickstart demonstrates how to initialize the Vonage client using API key and secret (preferably from environment variables) and then retrieve the current account balance and top-up status using the `client.account` interface."},"warnings":[{"fix":"Update imports from `nexmo` to `vonage` (e.g., `import vonage` instead of `import nexmo`). Re-initialize the client using `vonage.Vonage` instead of `nexmo.Client`. Review migration guides for full API changes if upgrading from very old versions.","message":"The Vonage Python SDK transitioned from `nexmo` to `vonage` as the top-level package and client name. Older code relying on `import nexmo` or `nexmo.Client` will raise `ModuleNotFoundError` or other API incompatibilities with current SDK versions.","severity":"breaking","affected_versions":"<4.0.0"},{"fix":"Always install the main `vonage` package and use `from vonage import Vonage, Auth` to create your client. Access Account API methods via the `client.account` property.","message":"The Vonage Python SDK is a monorepo. While `vonage-account` is a separate PyPI package, its functionalities are typically accessed through the unified `vonage.Vonage` client instance (e.g., `client.account.get_balance()`). Directly importing and instantiating classes from `vonage_account` might bypass the central configuration and authentication setup of the main SDK, leading to unexpected behavior or missing features.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Refer to the official Vonage Python SDK documentation for the current structure and availability of specific API methods. Use modern authentication patterns (API Key/Secret or Application ID/Private Key) based on the API endpoint.","message":"Some APIs that were historically grouped under 'account' or 'pricing' in other SDKs (e.g., Java) have been removed or moved in newer SDK versions. Always consult the specific Python SDK documentation for the latest API availability.","severity":"deprecated","affected_versions":"Varies by API, potentially SDK versions 4.x.x+"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Change `import nexmo` to `import vonage` and update client instantiation from `nexmo.Client(...)` to `vonage.Vonage(auth=Auth(...))`. You might also need to update method calls.","cause":"The project is trying to import the old `nexmo` Python client library, which has been renamed to `vonage` since version 4.0.0 of the SDK.","error":"ModuleNotFoundError: No module named 'nexmo'"},{"fix":"Verify your `VONAGE_API_KEY` and `VONAGE_API_SECRET` environment variables or directly passed credentials against your Vonage Dashboard. Ensure they are active and have the correct permissions for the Account API.","cause":"The API key or secret provided to the Vonage client is incorrect, invalid, or lacks the necessary permissions for the requested operation.","error":"vonage.exceptions.AuthenticationError: 401 Unauthorized"},{"fix":"Review the Vonage API documentation for the specific Account API method you are calling (e.g., get_balance, update_settings) and ensure all mandatory parameters are included in your request.","cause":"The API request is missing one or more required parameters for the specific Account API endpoint being called.","error":"vonage.exceptions.HttpRequestError: 400 Bad Request - Missing Parameters"}]}