Skip to main content
AgentTax

API Reference

Tax intelligence, gain/loss tracking, and compliance for AI-to-AI transactions.

Quick Start

Get tax-compliant in under 5 minutes.

1
Create Account
POST /api/v1/auth/signup with your email. Save the API key — shown once.
2
Calculate Tax
POST /api/v1/calculate with role, amount, buyer_state, and transaction_type.
3
Track Gains
POST /api/v1/trades to log buys/sells. Cost basis and gains are automatic.
Python SDK
pip install agenttax
Full example — Python
from agenttax import AgentTaxClient

client = AgentTaxClient(api_key="atx_live_YOUR_KEY")

# Calculate sales tax
result = client.calculate(
    role="seller",
    amount=2500,
    buyer_state="TX",
    transaction_type="api_access",
    counterparty_id="buyer_01",
)

print(result["total_tax"])     # 125.0
print(result["confidence"])    # {"score": 85, "level": "high"}

# Log a capital gains trade
trade = client.log_trade(
    asset_symbol="COMPUTE_CREDIT",
    trade_type="buy",
    quantity=100,
    price_per_unit=0.25,
)
Full example — curl
# 1. Sign up
curl -X POST https://agenttax.io/api/v1/auth/signup \
  -H "Content-Type: application/json" \
  -d '{"email":"agent@example.com","password":"securepass8+","agent_name":"My Agent","agent_work_type":"compute"}'

# 2. Calculate tax (seller side)
curl -X POST https://agenttax.io/api/v1/calculate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: atx_live_YOUR_KEY" \
  -d '{"role":"seller","amount":2500,"buyer_state":"TX",
       "transaction_type":"api_access","counterparty_id":"buyer_01"}'

# 3. Log a trade
curl -X POST https://agenttax.io/api/v1/trades \
  -H "Content-Type: application/json" \
  -H "X-API-Key: atx_live_YOUR_KEY" \
  -d '{"asset_symbol":"COMPUTE_CREDIT","trade_type":"buy",
       "quantity":100,"price_per_unit":0.25}'
Expected response — /calculate
{
  "success": true,
  "jurisdiction": "Texas",
  "classification_basis": "data_processing",
  "sales_tax": {
    "amount": 125.00,
    "rate": 0.0625,
    "taxable_pct": 0.80,
    "note": "TX Tax Code §151.351 — 20% statutory exemption"
  },
  "confidence": { "score": 85, "level": "high" },
  "total_tax": 125.00
}

That's it — one request, and you get the tax amount, the statute, and a confidence score. The free tier gives you 100 calls/month with no credit card. Upgrade anytime from your dashboard.

Authentication

Include your API key in every authenticated request.

Header format
X-API-Key: atx_live_YOUR_KEY_HERE

Also accepts Authorization: Bearer atx_live_... — Keys are SHA-256 hashed. Raw key shown once at creation.

Free
100/mo
Hard cutoff
Starter $25/mo
10,000/mo
$0.01 overage
Growth $99/mo
100,000/mo
$0.01 overage
Pro $199/mo
1,000,000/mo
$0.005 overage
Test Mode

Test mode (atx_test_ prefixed keys) is on the roadmap. Until available, use the free tier (100 calls/month, no credit card) for integration testing. The free tier writes to live data — use a dedicated test account.

Rate Limiting

Requests are rate-limited per API key. Exceeding your plan's monthly limit returns 403. Burst rate limiting (per-second) returns 429 with a Retry-After header.

Response headers on every request
Headers
X-RateLimit-Limit: 10000        # Monthly call limit for your plan
X-RateLimit-Remaining: 9842     # Calls remaining this month
X-RateLimit-Reset: 1714521600   # UTC timestamp when monthly limit resets

# On 429 responses:
Retry-After: 2                  # Seconds to wait before retrying

Recommended retry strategy for autonomous agents: exponential backoff starting at 1 second, maximum 5 retries, jitter ±20%.

Error Responses

All endpoints return errors in a consistent envelope. SDKs should branch on code (a frozen SCREAMING_SNAKE enum) rather than the human-readable error string.

StatusCodeMeaning
400INVALID_INPUTRequest body or query param failed validation
400INVALID_JSON_BODYBody present but JSON.parse failed
400IDEMPOTENCY_KEY_INVALIDIdempotency-Key header malformed (length / charset)
401UNAUTHORIZEDMissing/invalid API key, session, or partner secret
401WEBHOOK_SIGNATURE_INVALIDOutbound webhook delivery callback failed HMAC verification
402PAYMENT_REQUIREDx402 / MPP missing or invalid; demo daily limit hit and unauthenticated
403FORBIDDENAuthenticated but lacks permission (cross-tenant, deactivated partner, etc.)
403TIER_LIMIT_REACHEDPlan limits exceeded (monthly call cap, agent count cap)
404RESOURCE_NOT_FOUNDEntity / API key / partner / record / endpoint not found
405METHOD_NOT_ALLOWEDWrong HTTP method for the route
409RESOURCE_CONFLICTUnique-constraint violation, soft-deleted collision, optimistic-CAS lost race
409IDEMPOTENCY_KEY_CONFLICTSame Idempotency-Key reused with different request body
422NEXUS_NOT_REACHEDCalculation requested for a state where the entity has no nexus configured
429RATE_LIMITEDBurst rate limiter or demo-IP limiter tripped — see Retry-After
500INTERNALUnexpected server error — safe to retry with exponential backoff
503DB_UNAVAILABLEPostgres unreachable — transient; retry
Error Response Shape
{
  "success": false,
  "code": "INVALID_INPUT",
  "error": "buyer_state is required for seller role calculations",
  "request_id": "req_01HX..."
}

Tax Engine

Calculate sales tax, use tax, and 1099 obligations. Specify your role — seller gets collection obligations; buyer gets use tax exposure and seller remittance verification.

POST/api/v1/calculateAPI Key
Calculate tax obligations. Sellers get sales tax with nexus/exemption checks. Buyers get use tax, seller remittance status, and 1099 tracking. Add buyer_zip for combined state+local rates.
POST/api/v1/calculateAPI Key
Buyer example — use tax, seller remittance verification, 1099 tracking.
GET/api/v1/transactionsAPI Key
List transaction history with tax calculations.

Gain/Loss Tracker

Track trades, manage cost basis lots (FIFO/LIFO/Specific ID), and calculate realized capital gains. Supports fractional quantities to 8 decimals — crypto, compute credits, data bundles, any tradeable AI agent asset.

POST/api/v1/tradesAPI Key
Log a buy or sell. Buys create cost basis lots. Sells match lots and compute realized gains with holding period classification.
POST/api/v1/tradesAPI Key
Sell — matches lots via FIFO and computes realized gains.
GET/api/v1/tradesAPI Key
List trades with per-asset summary stats.

Accounts & Keys

Create accounts, manage API keys, handle dashboard authentication.

POST/api/v1/auth/signup
Create a free account with agent registration. No credit card.
POST/api/v1/auth/login
Log in → session token for dashboard.
GET/api/v1/auth-meSession Token
Get current user profile and usage.
GET/api/v1/keysAPI Key
List API keys (prefixes only).
POST/api/v1/keysAPI Key
Generate a new API key.
DELETE/api/v1/keysAPI Key
Revoke a key by prefix.
POST/api/v1/checkout
Stripe checkout to upgrade plan.

Agent Network

Register agents, manage tax profiles, discover counterparties, configure nexus.

POST/api/v1/networkAPI Key
Create or update your network profile.
GET/api/v1/networkAPI Key
Get your network profile.
GET/api/v1/network-directory
Browse public agents.
POST/api/v1/nexusAPI Key
Configure nexus status for a state.
GET/api/v1/nexusAPI Key
List all nexus configs.

Compliance

Nexus threshold monitoring, idempotency for agent retries, and 1099-DA draft exports.

GET/api/v1/nexus-alertsAPI Key
Check economic nexus thresholds across all 51 US jurisdictions. Returns alerts for states where your YTD revenue is ≥80% of the threshold.
GET/api/v1/export/1099-daAPI Key
Generate a draft 1099-DA (Digital Asset Proceeds) export. Returns JSON matching IRS form fields — ready for tax software import or accountant handoff.

Idempotency Keys

AI agents frequently retry failed network calls. To prevent duplicate tax entries or double-counted trades, include an Idempotency-Key header on POST requests.

Usage
curl -X POST https://agenttax.io/api/v1/trades \
  -H "Content-Type: application/json" \
  -H "X-API-Key: atx_live_YOUR_KEY" \
  -H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
  -d '{"asset_symbol":"ETH","trade_type":"buy","quantity":1,"price_per_unit":3000}'

# Retry with same key → returns cached response, no duplicate entry
# Response includes: X-Idempotency-Status: cached
Supported on
POST /calculate, /trades
Key TTL
24 hours
Cache header
X-Idempotency-Status

Reference Data

Public endpoints — no authentication required.

GET/api/v1/health
API status and database connectivity.
GET/api/v1/rates
Tax rates for all 50 states + DC. Filter by state.
GET/api/v1/rates/local
Combined state+local tax rate for a specific zip code. No auth required. Use buyer_zip in POST /api/v1/calculate to get this applied automatically.
POST/api/v1/verify
Cross-check a tax rate against AgentTax's verified sources.
GET/api/v1/blog
Blog articles with metadata (20 articles).
GET/api/v1/rss
RSS feed for blog syndication.

Questions? support@agenttax.io

© 2026 Agentic Tax Solutions. All obligations belong to the legal entity, not the AI agent.