Skip to main content

Python SDK for the AgentTax API — sales tax, use tax, and capital gains for AI agents

Project description

AgentTax Python SDK

Sales tax, use tax, and capital gains for AI agents. Full docs at agenttax.io/api-docs.

Install

pip install agenttax

Quickstart

from agenttax import AgentTaxClient

client = AgentTaxClient(api_key="atx_live_...")

# Calculate sales tax
result = client.calculate(
    role="seller",
    amount=1000.00,
    buyer_state="TX",
    transaction_type="saas",
    counterparty_id="agent_buyer_001",
    is_b2b=True,
)

print(result["taxable"])     # True
print(result["total_tax"])   # 50.0 (5% TX — 80% rule applied)
print(result["confidence"])  # {"score": 95, "level": "high"}

API Key

Get a free API key at agenttax.io — 100 calls/month at no cost.

Methods

calculate(**kwargs)

Calculate sales tax for a transaction.

Parameter Type Required Description
role str "seller" or "buyer"
amount float Transaction amount in USD
buyer_state str Two-letter state code
transaction_type str "saas", "compute", "consulting", etc.
counterparty_id str Counterparty identifier
work_type str "compute", "research", "content", "consulting", "trading"
is_b2b bool Business-to-business transaction
buyer_zip str 5-digit ZIP for local rate lookup

get_rates(state=None, format=None, explain=False)

Fetch sales tax rates for all 51 jurisdictions. No auth required.

get_capital_gains_rates(state=None)

Fetch state capital gains rates. No auth required.

get_local_rate(zip_code)

Fetch combined local + state rate for a ZIP code.

get_transactions(limit=50, offset=0, ...)

Fetch transaction history. Auth required.

log_trade(**kwargs) / get_trades(**kwargs)

Capital gains trade tracking (FIFO/LIFO/Specific ID). Auth required.

Error Handling

from agenttax import AgentTaxClient, AuthError, RateLimitError, ValidationError

client = AgentTaxClient(api_key="atx_live_...")

try:
    result = client.calculate(...)
except AuthError:
    # Invalid or missing API key
    pass
except RateLimitError:
    # Monthly quota exceeded — upgrade tier or wait
    pass
except ValidationError as e:
    # Bad request parameters
    print(e)

Free Tier

100 API calls/month at $0. Paid plans start at $25/month (10K calls). See agenttax.io/pricing.

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

agenttax-0.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

agenttax-0.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file agenttax-0.1.0.tar.gz.

File metadata

  • Download URL: agenttax-0.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for agenttax-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1efc066fd14eafef8ee25bda933d84f4ff3efe076d7f661a5389360f44fa0bcd
MD5 a4522388e19edb16a5620b3fae5073c7
BLAKE2b-256 ff6286b8457bb3b825a4050b17c47f71201dbba43f01467ff56f84f381f55c68

See more details on using hashes here.

File details

Details for the file agenttax-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agenttax-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for agenttax-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ffb64f332704e9799de9f4a33f377546b8e6fee0e00e8504fca30a1aa5d512a
MD5 1a9059cfb6ef53f46b726ddf95634621
BLAKE2b-256 d8f1944c26e4af053806c436e57c3d0664770fc17518611f9d3e4f5b1dfb9ab7

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