Skip to main content

taxrail — Autonomous Pre-Trade Crypto Tax SDK for Python AI Agents

Zero-dependency Python client and ready-to-use tool wrappers (OpenAI Function Calling, LangChain, CrewAI) for TaxRail (https://api.taxrail.online).

Before any autonomous agent executes a DEX swap, sells appreciated crypto, rebalances a treasury, or pays invoices, TaxRail computes:

  • US IRS 1099-DA & Form 8949: Per-wallet SpecID / HIFO lot selection, Short-Term → Long-Term cliff alerts, and year-end Tax-Loss Harvesting (TLH).
  • Brazil Lei 14.754/2023 & R$35k Rule: Instant domestic monthly R$35,000 exemption headroom vs offshore/DEX 15% flat tax + Lucro Real 34%.
  • DeFi Borrow-vs-Sell: Aave v3 non-custodial borrow comparison when tax cost exceeds interest cost.
  • 20% Affiliate RevShare: Pass referrer_wallet="0xYourWallet" to earn 20% of TaxRail's fees automatically on Base USDC (eip155:8453).

Install

pip install taxrail

Optional framework integrations:

pip install "taxrail[langchain]"
pip install "taxrail[crewai]"

Quickstart

from taxrail import TaxRailClient, TaxRailPaymentRequiredError

client = TaxRailClient(referrer_wallet="0xYourIntegratorWallet")

# 1. FREE Step-1 pre-trade tax preview
preview = client.check_tax_impact(
    jurisdiction="US",
    regime="INDIVIDUAL",
    chain="base",
    target_asset="ETH",
    sell_quantity=1.0,
    wallet_address="0x849151d7D0bF1F34b70d5caD5149D28CC2308bf1",
)
print(preview["taxSavedUsd"], preview["planId"])

# 2. Paid x402 micro-endpoints ($0.01 pre-trade check, $0.005 BR R$35k check, $0.01 TLH scan)
try:
    status = client.br_35k_status(
        monthly_sales_brl=20000,
        planned_sale_usd=2500,
        custody_location="DOMESTIC",
    )
except TaxRailPaymentRequiredError as exc:
    # Contains parsed x402 v2 payment requirements (amount in USDC atomic units, network=eip155:8453, payTo)
    print("Pay x402 challenge:", exc.payment_required["accepts"][0])

AI Framework Tool Wrappers

from taxrail import TaxRailClient, get_openai_tools, as_langchain_tools, as_crewai_tools

client = TaxRailClient()
openai_tools = get_openai_tools()
lc_tools = as_langchain_tools(client)
crew_tools = as_crewai_tools(client)

Metadata

Release files for taxrail 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 taxrail 0.1.0
File Size Uploaded Provenance Actions
taxrail-0.1.0.tar.gz 11.7 kB Without provenance Details for taxrail-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 21.1 kB

Release files / taxrail-0.1.0.tar.gz

Download URL taxrail-0.1.0.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3503b0850382cc8e196463a7128d26bd878ac33f2ead8f191cd8474df9037a41
BLAKE2b-256 checksum
How to use checksums
c6f5551086ba84c7c32314d20ce3fc6e665fe4f58a0c716b814af1d9a8ff88b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL taxrail-0.1.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4ba3378cc606ff13c43074f1233420d40daa857a70f15fb0b6751f6a3050243
BLAKE2b-256 checksum
How to use checksums
098a30dfdd7a39817c8d4c29ac44aa8a34db4d38a215f084ee3f5cfc87079a43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for taxrail 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