Skip to main content

Algate Python SDK

The Python SDK exposes the same guard() contract as the TypeScript client and implements x402 exact payments natively for Algorand MainNet.

pip install algate-sdk
# fallback (site-hosted wheel):
# pip install https://algate-x402.up.railway.app/sdk/algate_sdk-0.1.0-py3-none-any.whl
import os
from algate import Algate, create_payment_id

payment_id = create_payment_id("invoice_")

with Algate(os.environ["PAYER_MNEMONIC"]) as algate:
    result = algate.guard(
        {
            "action": "pay_x402",
            "request": {"url": target_url, "method": "GET"},
            "payment_required": payment_required_header,
            "policy": {
                "max_amount_usdc": "0.05",
                "allowed_hosts": ["api.example.com"],
                "allowed_pay_to": [trusted_merchant],
                "require_payment_identifier": True,
            },
        },
        payment_id=payment_id,
    )

if result["recommended_action"] == "pay":
    # The target payment still belongs to the agent.
    pass

Persist payment_id with the logical operation and reuse it after a timeout or process restart. The mnemonic remains local and is only used to pay Algate's own $0.001 analysis fee. Algate never receives the key and never pays the target merchant.

Metadata

Release files for algate-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for algate-sdk 0.1.0
File Size Uploaded Provenance Actions
algate_sdk-0.1.0.tar.gz 6.4 kB Without provenance Details for algate_sdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for algate-sdk 0.1.0
File Interpreter ABI Platform Actions
algate_sdk-0.1.0-py3-none-any.whl Python 3 none any Details for algate_sdk-0.1.0-py3-none-any.whl

Total release size: 12.5 kB

Release files / algate_sdk-0.1.0.tar.gz

Download URL algate_sdk-0.1.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
06a7f74ff01820c9b2e41179f860e16c7cca6e4b6a5e87b5ee07d218ab03b1d8
BLAKE2b-256 checksum
How to use checksums
da646a5395227fdc878231d686d6b8e1ec53dd05ed23234e3f52bd3be6fdf505
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / algate_sdk-0.1.0-py3-none-any.whl

Download URL algate_sdk-0.1.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db3b620a7c1c4f06869b83a82894748c40d00558855451dcb8b28550ce95737e
BLAKE2b-256 checksum
How to use checksums
d6adac8dae5335ee250e5ac8b9a1b876353f086b47d5dd75a061f483834105c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for algate-sdk 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page