Introducing the AgentTax Python SDK
AI agents are transacting autonomously — purchasing compute, selling API access, trading tokens, subscribing to SaaS services. And nobody is handling the tax.
When an AI agent in Delaware sells $2,500 of API access to an agent in Texas, someone owes Texas 8.25% sales tax. When a trading bot flips compute tokens, someone owes capital gains. Right now this is a blind spot that becomes a massive compliance problem as agentic commerce scales.
Today we're releasing the AgentTax Python SDK. Your AI agents can handle sales tax, use tax, 1099 obligations, and capital gains tracking automatically.
Install
pip install agenttax
The source lives in the AgentTax monorepo under sdks/python. You can also skip the SDK entirely and call the REST API at https://agenttax.io/api/v1 — that path needs no account at all.
One dependency: requests.
Calculate Use Tax in 5 Lines
from agenttax import AgentTaxClient
client = AgentTaxClient(api_key="atx_live_your_key")
result = client.calculate(
role="buyer",
amount=1000.00,
buyer_state="TX",
transaction_type="compute",
counterparty_id="agent_seller_001",
)
print(result["total_tax"]) # 50.0
print(result["combined_rate"]) # 0.0625
calculate() returns the decoded JSON body, so read it as a mapping.
Want to see that number before you sign up for anything? The same call works against the REST API with no key and no account — it comes back in demo mode:
curl -s https://agenttax.io/api/v1/calculate \
-H "Content-Type: application/json" \
-d '{"role":"buyer","amount":1000.00,"buyer_state":"TX",
"transaction_type":"compute","counterparty_id":"agent_seller_001"}'
Start buyer-side if you want to see a live number. A seller only owes collection where it has nexus, so role="seller" returns total_tax of 0 until you configure nexus — that is the correct answer, not an error.
Track Capital Gains
Trades go through one method, with the side named explicitly:
client.log_trade(
asset_symbol="COMPUTE",
trade_type="buy",
quantity=100,
price_per_unit=12.50,
)
client.log_trade(
asset_symbol="COMPUTE",
trade_type="sell",
quantity=50,
price_per_unit=18.00,
cost_basis_method="fifo",
)
trades = client.get_trades(asset_symbol="COMPUTE")
Cost basis is tracked automatically using FIFO (or LIFO, or Specific ID — pass cost_basis_method to choose). Logging trades needs an API key.
LangChain, CrewAI and MCP
The SDK is a plain HTTP client with no framework coupling, so wrapping it as a tool is a few lines in whichever framework you use. Worked examples for each:
- MCP — an MCP server, if your framework speaks that instead
What It Covers
- Sales tax and use tax for all 50 US states
- Buyer and seller role support (both sides of every transaction)
- Nexus checking and exemption certificates
- 1099 obligation tracking
- Cost basis management (FIFO, LIFO, Specific ID)
- Realized gain/loss with holding period classification
- 50-state rate data verified daily against 7 independent public sources
- Agent network directory
Free Tier
1,500 API calls per month. Enough to build, test, and ship. Demo mode needs no account at all.
Get started at agenttax.io.
Related Articles
Denver Runs Its Own Multiple-Points-of-Use Rule, and Colorado's State Exemption Never Reaches It
6 min readTechnical Deep DiveMultiple Points of Use: The Massachusetts Apportionment Rule California Is Copying, Read Against AI Agents
7 min readFundamentalsThe 1099 Problem: When Your AI Agent Pays 50 Vendors a Day
6 min read