a2a-greenhelix-sdk
Python SDK for the A2A Commerce Platform -- agent-to-agent payments, escrow, marketplace, identity, and trust scoring.
Installation
pip install a2a-greenhelix-sdk
Requires Python 3.11+. Single dependency: httpx.
Quick Start
import asyncio
from a2a_client import A2AClient
async def main():
async with A2AClient("https://api.greenhelix.net", api_key="a2a_free_...") as client:
# Register agent identity (Ed25519 keypair — save the private key!)
identity = await client.register_agent("my-agent")
print(f"Public key: {identity.public_key}")
# Get wallet balance
balance = await client.get_balance("my-agent")
print(f"Balance: {balance}")
# Create and capture a payment
intent = await client.create_payment_intent(
payer="buyer-agent", payee="seller-agent", amount=10.0
)
settlement = await client.capture_payment(intent["intent_id"])
asyncio.run(main())
Configuration
client = A2AClient(
base_url="https://api.greenhelix.net", # or http://localhost:8000
api_key="a2a_free_...",
timeout=30.0, # request timeout (seconds)
max_retries=3, # automatic retries with backoff
)
Convenience Methods
| Method | Description |
|---|---|
health() |
Health check |
get_balance(agent_id) |
Wallet balance |
deposit(agent_id, amount) |
Add credits |
get_usage_summary(agent_id) |
Usage stats |
create_payment_intent(...) |
Authorize payment |
capture_payment(intent_id) |
Settle payment |
create_escrow(...) |
Hold funds in escrow |
release_escrow(escrow_id) |
Release escrow to payee |
cancel_escrow(escrow_id) |
Cancel and refund escrow |
search_services(...) |
Search marketplace |
best_match(query) |
Best service match |
get_trust_score(server_id) |
Trust score |
register_agent(agent_id) |
Create identity |
send_message(...) |
Encrypted messaging |
negotiate_price(...) |
Price negotiation |
create_subscription(...) |
Recurring payments |
register_webhook(...) |
Event webhooks |
batch_execute(calls) |
Multi-tool batch |
execute(tool, **params) |
Generic tool call |
Generic Tool Execution
For tools without a convenience method:
result = await client.execute("get_agent_reputation", agent_id="some-agent")
Batch Operations
results = await client.batch_execute([
{"tool": "get_balance", "params": {"agent_id": "agent-1"}},
{"tool": "get_balance", "params": {"agent_id": "agent-2"}},
])
Error Handling
from a2a_client.errors import A2AError, InsufficientCreditsError, RateLimitError
try:
result = await client.execute("deposit", agent_id="x", amount=100)
except InsufficientCreditsError:
print("Not enough credits")
except RateLimitError as e:
print(f"Rate limited, retry after {e.retry_after}s")
except A2AError as e:
print(f"API error: {e.code} - {e.message}")
Links
License
MIT
Metadata
Release files for a2a-greenhelix-sdk 1.4.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| a2a_greenhelix_sdk-1.4.5.tar.gz | 27.8 kB | With provenance | Details for a2a_greenhelix_sdk-1.4.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| a2a_greenhelix_sdk-1.4.5-py3-none-any.whl | Python 3 | none | any | Details for a2a_greenhelix_sdk-1.4.5-py3-none-any.whl |
Total release size: 46.5 kB
Release files / a2a_greenhelix_sdk-1.4.5.tar.gz
| Download URL | a2a_greenhelix_sdk-1.4.5.tar.gz |
|---|---|
| Size | 27.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
acb74019924d9a408102f3dbaa0b52cb8b294b417e6bed3e1c2eb0a7b6b3b450
|
|
BLAKE2b-256 checksum How to use checksums |
d31312f4cb2b66b9108a2672ee0cec1b96572f9cb43c93d6cc13e796f2d6e5c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 14, 2026.
Transparency logRelease files / a2a_greenhelix_sdk-1.4.5-py3-none-any.whl
| Download URL | a2a_greenhelix_sdk-1.4.5-py3-none-any.whl |
|---|---|
| Size | 18.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ee6a30e3d00fe15aba3a079aea5ab9a353447cec57ddb759b7f91476646a1461
|
|
BLAKE2b-256 checksum How to use checksums |
1e190399ef792535eee196bb638641d753d5aca07f9fad1c5c263854c7a3133b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 14, 2026.
Transparency logSecurity for a2a-greenhelix-sdk 1.4.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for a2a_greenhelix_sdk-1.4.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 14, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.