AgentTax
Tax compliance tools for AI agent transactions. Use when the user or agent needs to:
- - Calculate sales tax or use tax on a transaction
- Log trades for capital gains tracking
- Check tax rates by state
- Configure economic nexus states
- Export 1099-DA data
API docs: https://agenttax.io/api/v1/agents
Authentication
All requests use the header: INLINECODE0
Get a free API key (100 calls/month):
CODEBLOCK0
Save the api_key.key from the response — it is only shown once.
Calculate Sales/Use Tax
Use when an AI agent buys or sells services, compute, API access, SaaS, or digital goods.
CODEBLOCK1
Required fields:
- -
role: "buyer" or INLINECODE4 - INLINECODE5 : transaction amount in USD
- INLINECODE6 : 2-letter US state code
- INLINECODE7 : one of
compute, api_access, data_purchase, saas, ai_labor, storage, digital_good, consulting, data_processing, cloud_infrastructure, ai_model_access, marketplace_fee, subscription, license, INLINECODE22 - INLINECODE23 : identifier for the other party
Optional fields:
- -
buyer_zip: 5-digit zip for local rate lookup (recommended — adds city/county tax) - INLINECODE25 :
compute, research, content, consulting, trading (drives per-state classification) - INLINECODE31 :
true/false (affects rates in MD, IA) - INLINECODE34 :
true/false (whether seller is collecting tax)
Response includes: total_tax, combined_rate, jurisdiction, audit_trail, confidence, advisories.
Sellers: you must configure nexus first (see below) or all calculations return $0.
Log Trades (Capital Gains)
Use when an agent buys or sells assets (compute tokens, crypto, etc.).
CODEBLOCK2
Cost basis methods: fifo (default), lifo, specific_id.
Get Tax Rates
CODEBLOCK3
Configure Nexus (Sellers Only)
Sellers must set nexus states to get non-zero tax results.
CODEBLOCK4
Health Check
CODEBLOCK5
Error Handling
All errors return { "success": false, "error": "message", "agent_guide": "https://agenttax.io/api/v1/agents" }.
- - 400: Bad request — check
error and errors fields - 401: Invalid or missing API key
- 429: Rate limited (free tier: 100 calls/month)
AgentTax
AI代理交易的税务合规工具。当用户或代理需要以下操作时使用:
- - 计算交易中的销售税或使用税
- 记录交易以追踪资本利得
- 按州查询税率
- 配置经济关联州
- 导出1099-DA数据
API文档:https://agenttax.io/api/v1/agents
身份验证
所有请求均使用请求头:X-API-Key: $AGENTTAXAPIKEY
获取免费API密钥(每月100次调用):
bash
curl -s -X POST https://agenttax.io/api/v1/auth/signup \
-H Content-Type: application/json \
-d {email: you@example.com, password: securepass, agent_name: my-agent}
保存响应中的api_key.key——该密钥仅显示一次。
计算销售税/使用税
当AI代理购买或销售服务、计算资源、API访问、SaaS或数字商品时使用。
bash
curl -s -X POST https://agenttax.io/api/v1/calculate \
-H X-API-Key: $AGENTTAXAPIKEY \
-H Content-Type: application/json \
-d {
role: ROLE,
amount: AMOUNT,
buyer_state: STATE,
buyer_zip: ZIP,
transaction_type: TYPE,
worktype: WORKTYPE,
counterparty_id: COUNTERPARTY,
isb2b: ISB2B
}
必填字段:
- - role:buyer或seller
- amount:交易金额(美元)
- buyerstate:两位美国州代码
- transactiontype:可选值包括compute、apiaccess、datapurchase、saas、ailabor、storage、digitalgood、consulting、dataprocessing、cloudinfrastructure、aimodelaccess、marketplacefee、subscription、license、service
- counterpartyid:交易对手标识符
可选字段:
- - buyerzip:用于查询本地税率的5位邮编(推荐——可增加市/县税)
- worktype:compute、research、content、consulting、trading(驱动各州分类)
- isb2b:true/false(影响马里兰州和爱荷华州的税率)
- sellerremitting:true/false(卖方是否代收税款)
响应包含: totaltax、combinedrate、jurisdiction、audit_trail、confidence、advisories。
卖方:必须首先配置关联(见下文),否则所有计算结果将返回$0。
记录交易(资本利得)
当代理购买或销售资产(计算代币、加密货币等)时使用。
bash
买入
curl -s -X POST https://agenttax.io/api/v1/trades \
-H X-API-Key: $AGENTTAX
APIKEY \
-H Content-Type: application/json \
-d {
asset_symbol: SYMBOL,
trade_type: buy,
quantity: QTY,
price
perunit: PRICE
}
卖出(返回已实现收益/亏损)
curl -s -X POST https://agenttax.io/api/v1/trades \
-H X-API-Key: $AGENTTAX
APIKEY \
-H Content-Type: application/json \
-d {
asset_symbol: SYMBOL,
trade_type: sell,
quantity: QTY,
price
perunit: PRICE,
accounting_method: fifo,
resident_state: STATE
}
成本基础方法:fifo(默认)、lifo、specific_id。
获取税率
bash
所有51个司法管辖区
curl -s https://agenttax.io/api/v1/rates
单个州及说明
curl -s https://agenttax.io/api/v1/rates?state=TX&explain=true
配置关联(仅限卖方)
卖方必须设置关联州才能获得非零的税务结果。
bash
curl -s -X POST https://agenttax.io/api/v1/nexus \
-H X-API-Key: $AGENTTAXAPIKEY \
-H Content-Type: application/json \
-d {
nexus: {
TX: { hasNexus: true, reason: 经济关联 },
NY: { hasNexus: true, reason: 实体存在 }
}
}
健康检查
bash
curl -s https://agenttax.io/api/v1/health
错误处理
所有错误返回{ success: false, error: message, agent_guide: https://agenttax.io/api/v1/agents }。
- - 400:错误请求——检查error和errors字段
- 401:API密钥无效或缺失
- 429:请求频率受限(免费套餐:每月100次调用)