Skip to main content

Modexia AgentPay — Python SDK for agent wallets & payments (USDC)

Project description

Modexia Python SDK

Lightweight Python client for interacting with the Modexia AgentPay API.

Features

  • Simple programmatic access to agent wallets and payments
  • Reliable retry/backoff for HTTP calls
  • Small surface area: ModexiaClient with transfer + retrieve_balance (or get_balance) helpers

Installation

# install locally (editable)
pip install -e packages/SDKs/pythonSdk

Quick start

from modexia import ModexiaClient

client = ModexiaClient(api_key="mx_test_...")

# you can also override the base url, or skip network validation
# client = ModexiaClient(api_key="mx_test_...", base_url="http://custom.url", validate=False)
# It will also respect the MODEXIA_BASE_URL environment variable

# read balance
print(client.retrieve_balance())
# print(client.get_balance()) # alias

# make a transfer (wait=True polls for on-chain confirmation)
receipt = client.transfer(recipient="0xabc...", amount=5.0, wait=True)
print(receipt)

API (short)

  • ModexiaClient(api_key: str, timeout: int = 15, base_url: Optional[str] = None, validate: bool = True)
    • retrieve_balance() -> str
    • get_balance() -> str (alias for retrieve_balance)
    • transfer(recipient: str, amount: float, idempotency_key: Optional[str] = None, wait: bool = True) -> dict
    • smart_fetch(url, ...) -> requests.Response

Errors / Exceptions

  • ModexiaAuthError — authentication problems
  • ModexiaPaymentError — payment/server errors
  • ModexiaNetworkError — network/connection failures

Testing

Run the unit tests with pytest from the repository root:

pytest -q packages/SDKs/pythonSdk

Contributing

Open a PR against the develop branch. Keep API names stable — this package uses ModexiaClient and transfer(...) as the canonical surface.

Install (PyPI)

pip install modexiaagentpay

If you prefer to try the local copy while iterating:

pip install -e packages/SDKs/pythonSdk

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

modexiaagentpay-0.3.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

modexiaagentpay-0.3.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file modexiaagentpay-0.3.0.tar.gz.

File metadata

  • Download URL: modexiaagentpay-0.3.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for modexiaagentpay-0.3.0.tar.gz
Algorithm Hash digest
SHA256 974247e1dcb0a527f02dd075492d32fda6797a39c727106d41198614d45fd1a3
MD5 2a934857fc5eff103299fafe31616cc3
BLAKE2b-256 2c271cf46b3ff4d5bd297b7e2247e13d83052d348f538aca21c879b6340a1f06

See more details on using hashes here.

File details

Details for the file modexiaagentpay-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for modexiaagentpay-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a508e47f19ff39c7f74f27225d97491ff82c9b61e421d0b1b925d7e17a4f5fb4
MD5 1ea8d3435cbee5253e86efd57cc1f5cb
BLAKE2b-256 e84c0f567327c34bc844de405f80279b8c3061fdd950dd724eb54de385db416a

See more details on using hashes here.

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