Agent API guide
Base URL: https://hts.epi.me
This file is the single free/paid map for agents. The OpenAPI document at /openapi.json remains the machine-readable source.
1. Authentication and payment
| Mode | Header | Use |
|---|---|---|
| No auth | none | Free endpoints only |
| API key | X-API-Key: hts_live_... or Authorization: Bearer ... | Paid endpoints without x402 |
| x402 | PAYMENT-SIGNATURE (v2) or X-PAYMENT (v1) | Pay-per-call in USDC |
| Workspace key | X-API-Key: ws_... on /v1/workspace/* | Tenant-scoped workspace |
| Admin token | X-Admin-Token | Tenant, member, and key management |
A paid request without a key or payment first receives 402 with an x402 challenge. Reuse the challenge's accepts entry, sign it, and retry with PAYMENT-SIGNATURE. USDC only: Base mainnet or Solana.
2. Free endpoints
| Method | Path | Returns |
|---|---|---|
| GET | /health | Service, mode, network, Stripe state, prices |
| GET | /v1/hts/search?q= | Up to 8 HTS candidates, no rates |
| GET | /v1/hts/catalog | 63 demo product terms |
| GET | /v1/hts/releases | Current USITC release and latest diff |
| GET | /v1/classify/hints?q= | Candidate classification hints |
| GET | /v1/screen/hints?q= | OFAC screening hints |
| GET | /v1/cpsc and /v1/cpsc/hints | CPSC recall screening |
| GET | /v1/uflpa and /v1/uflpa/hints | UFLPA entity screening |
| GET | /v1/rulings?number= | Official CBP CROSS ruling text |
| GET | /v1/rulings?q=&code= | Official CROSS search link or local import |
| GET | /v1/policy-events?q= | Federal Register titles and links |
| GET | /v1/coverage?code= | Which measure datasets cover an HTS8 |
| GET | /v1/data-versions | Dataset dates and modes |
| GET | /v1/plans | Plans and quotas |
| GET | /v1/account | Key holder's account (key required) |
| GET | /v1/invoices | Invoices (key required) |
| GET/POST/DELETE | /v1/watch* | Change-feed webhooks (key required) |
| GET | /v1/proof | Public settled-payment proof |
Free rate limit: 30 requests/minute per client IP.
3. Paid endpoints
| Price | Method | Path | Returns |
|---|---|---|---|
| $0.005 | GET | /v1/hts/{code} | Exact HTS line, MFN/special/other rates, units |
| $0.005 | GET | /v1/hts/{code}/duty | Itemised duty + breakdown |
| $0.005 | GET | /v1/measures | 301/232/AD-CVD metadata, periods, exclusions |
| $0.005 | GET | /v1/measures/changes | Effective-date events since a date |
| $0.010 | GET | /v1/landed-cost | Landed cost with fees and freight |
| $0.020 | GET | /v1/trade-actions | 301/232/AD-CVD/IEEPA status with citations |
| $0.010 | GET | /v1/classify | Classification candidates and reasoning |
| $0.010 | GET | /v1/screen | OFAC/BIS screening; never a clearance |
| $0.010 | GET | /v1/admissibility | Combined entity admissibility screen |
| $0.010 | GET | /v1/market/stats | Census import/export values by HS6 |
| $0.010 | POST | /v1/origin/qualify | USMCA questionnaire and evidence gaps |
| $0.005 | POST | /v1/documents/check | Invoice/packing/origin field check |
| $0.003/row | POST | /v1/landed-cost/batch | Up to 200 rows; min $0.01, max $0.60 |
| $0.005/row | POST | /v1/screen/batch | Up to 50 rows; min $0.01 |
| $99 | GET | /v1/dataset | One-time dataset bundle download |
Duty parameters
/v1/hts/{code}/duty accepts:
value_usd required
quantity, unit for specific or compound rates
origin_country two-letter code
as_of YYYY-MM-DD legal-date view
entry_type auto | formal | informal | none
transport_mode ocean | air | other
adcvd_rate_pct caller-supplied exporter rate
product_description Section 301 exclusion scoring
exporter AD/CVD company-rate lookup
metal_content_pct Section 232 15% threshold
copper_content_pct copper content for multi-list aggregate
aluminum_content_pct aluminum content for multi-list aggregate
steel_content_pct steel content for multi-list aggregate
us_content_pct copper cable 85% U.S. content tier
parts_use agricultural/fixed/mobile industrial equipment
column1_rate_pct column 1 rate for 9903.82.23-.26
Unknown inputs are returned as missing, never as zero.
4. Trial rules
- HTTP: 3 paid calls per UTC day per client, only on
/v1/hts/{code},
/v1/hts/{code}/duty, /v1/landed-cost, /v1/trade-actions, /v1/classify, /v1/screen.
- Add
trial=offto disable the trial for one request. - MCP: 20 paid-tool calls per UTC day per client. Free MCP tools:
search_hts, screen_uflpa, search_cpsc_recalls, get_hts_release.
- Paid MCP tools:
get_hts_code,estimate_duty,estimate_landed_cost,
get_trade_actions, classify_product, screen_sanctions, estimate_landed_cost_batch, get_measures, get_measure_changes.
- Trial usage is shared per client, not per endpoint.
5. Workspace
Tenant-scoped reads with X-API-Key: ws_...:
GET /v1/workspace/skus
GET /v1/workspace/scenarios
GET /v1/workspace/reports
POST /v1/workspace/skus
POST /v1/workspace/scenarios
POST /v1/workspace/reports
Admin token required:
POST /v1/workspace/tenants
POST /v1/workspace/members
POST /v1/workspace/members/role {tenant_id, member_id, role}
GET /v1/workspace/members?tenant_id=
GET /v1/workspace/keys?tenant_id=[&member_id=]
GET /v1/workspace/audit?tenant_id=[&limit=]
POST /v1/workspace/keys/rotate {tenant_id, member_id}
POST /v1/workspace/keys/revoke {tenant_id, fingerprint}
DELETE /v1/workspace/members/<id>?tenant_id=
Keys are shown once at issue or rotation. The listing returns only a 16-character fingerprint.
6. Agent decision table
| Goal | Call |
|---|---|
| Find an HTS candidate | free /v1/hts/search |
| Exact current rate | paid /v1/hts/{code} |
| Duty for one shipment | paid /v1/hts/{code}/duty |
| Total landed cost | paid /v1/landed-cost |
| Why a duty applies | paid /v1/trade-actions or /v1/measures |
| Rules on a past date | paid /v1/measures?as_of= or /duty?as_of= |
| What changed recently | paid /v1/measures/changes?since= |
| Section 301 exclusion candidate | /duty with product_description |
| Sanctions/admissibility | free hints, then paid /v1/screen or /v1/admissibility |
| CBP ruling text | free /v1/rulings?number= |
| Market size | paid /v1/market/stats |
| Batch pricing | /v1/landed-cost/batch |
7. Errors and guards
400invalid input; the message names the field.401missing or invalid key.402payment required; body contains the x402 challenge.403admin token required or viewer role read-only.404unknown code or ruling.429rate limit.503feature not configured.
The API never treats a missing measure as zero. Applied measures carry a source, effective dates or missing; AD/CVD is not auto-added without an explicit rate; screening never returns "cleared".