Skip to main content
AgentTax
SKALE INTEGRATION

Tax compliance for gasless x402 on SKALE

SKALE is gasless. Sub-cent x402 payments are finally profitable — which means a merchant can do 100K+ transactions a day for real money. At that volume, per-state sales tax isn't optional, and no existing tax API can afford to serve it. AgentTax is the one that can.

Drops in alongside @x402/hono with a post-settlement recording call. 51 US state-level jurisdictions plus 100+ zip-level local rates, with statute citations and confidence scores on every record.

Why this matters on SKALE specifically

Micropayments become economically viable
Base settlement: ~$0.01–$0.05 in gas per x402 transaction. SKALE: $0. A merchant selling $0.0001 API calls can't operate on Base. On SKALE they can — and at 10K transactions/day, tax compliance becomes a real obligation, not a rounding error.
Avalara and Stripe Tax don't work at this scale
Per-transaction APIs priced at $0.50+/call kill the unit economics. AgentTax's free tier handles 1,500/mo; paid tiers scale to 1M/mo at $0.0002/call. Built for sub-cent commerce.
Per-jurisdiction records, no reconstruction from chain data
Every settled transaction logs with buyer state, classification (digital_service, compute, etc.), confidence score, and source citations. At filing time, you export — no spreadsheet archaeology on a million on-chain txs.

3-step integration

01
Get your API key
Sign up at agenttax.io — free tier, no credit card. 1,500 calls/month, API key in under 60 seconds.
02
Record every settled SKALE transaction
In your @x402/hono route handler (runs after SKALE settlement succeeds), POST to AgentTax with the amount and buyer state. Returns a transaction_id and the tax breakdown by jurisdiction for that sale.
03
Remit tax from gross at filing
You collected full payment — gasless. AgentTax has the obligation logged per state and zip-level local. At filing time, the data is structured for your accountant or the state DOR.

The handler

SKALE's x402 cookbook uses @x402/hono with the DirtRoad facilitator. Add the AgentTax fetch inside your route handler — that's it.

// SKALE x402 merchant — record each gasless settlement to AgentTax.
// SKALE is gasless: $0.0001 transactions are profitable, which means
// compliance becomes necessary at transaction counts Avalara can't handle.
import { Hono } from "hono";
import { paymentMiddleware, x402ResourceServer } from "@x402/hono";
import { ExactEvmScheme } from "@x402/evm/exact/server";
import { HTTPFacilitatorClient } from "@x402/core/server";

const app = new Hono();
const facilitator = { url: "https://facilitator.dirtroad.dev" };
const facilitatorClient = new HTTPFacilitatorClient(facilitator);

// Flip SKALE_CHAIN_ID between 324705682 (Sepolia testnet)
// and 1187947933 (SKALE Base Mainnet) without code changes.
const NETWORK = `eip155:${process.env.SKALE_CHAIN_ID || "324705682"}`;

app.use("*", paymentMiddleware(
  {
    "GET /paid": {
      accepts: [{
        scheme: "exact",
        network: NETWORK,
        payTo: process.env.RECEIVING_ADDRESS,
        price: {
          amount: "10000",                 // 0.01 USDC, atomic units (6 decimals)
          asset: process.env.PAYMENT_TOKEN_ADDRESS,
        },
      }],
    },
  },
  new x402ResourceServer(facilitatorClient).register(NETWORK, new ExactEvmScheme()),
));

async function recordTax({ amount, buyerState, counterpartyId }) {
  const res = await fetch("https://agenttax.io/api/v1/calculate", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "Authorization": `Bearer ${process.env.AGENTTAX_API_KEY}`,
    },
    body: JSON.stringify({
      role: "seller",
      amount,
      buyer_state: buyerState,
      transaction_type: "compute",
      counterparty_id: counterpartyId,
    }),
  });
  if (!res.ok) throw new Error(`AgentTax ${res.status}`);
  return res.json();
}

app.get("/paid", async (c) => {
  const buyerState = c.req.query("buyer_state") || process.env.AGENTTAX_DEFAULT_STATE;
  try {
    const tax = await recordTax({
      amount: 0.01,
      buyerState,
      counterpartyId: c.req.header("x-payer-address") || "anonymous",
    });
    return c.json({
      data: "your paid resource",
      agenttax: {
        transaction_id: tax.transaction_id,
        tax_amount: tax.sales_tax?.amount,
        tax_rate: tax.sales_tax?.combined_rate,
        jurisdiction: tax.sales_tax?.jurisdiction,
      },
    });
  } catch {
    return c.json({ data: "your paid resource", agenttax: { error: "record_failed" } });
  }
});

Sub-cent settlement is where x402 and state sales tax disagree most, and rounding is not the only place. The x402 tax compliance reference works through the four gaps that surface in production.

Response shape

{
  "success": true,
  "role": "seller",
  "amount": 100,
  "buyer_state": "TX",
  "transaction_type": "compute",
  "jurisdiction": "Texas",
  "combined_rate": 0.0625,
  "classification_basis": "data_processing",
  "total_tax": 5,
  "sales_tax": {
    "jurisdiction": "Texas",
    "combined_rate": 0.0625,
    "amount": 5,
    "taxable_amount": 80,
    "taxable_percentage": 0.8,
    "note": "TX Tax Code §151.351 — 20% statutory exemption"
  },
  "use_tax": null,
  "confidence": {
    "score": 72,
    "level": "partial"
  },
  "transaction_id": "txn_skale_abc123"
}

SKALE Base chains

SKALE Base Sepolia Testnet
eip155:324705682
Default — safe for dev and demos
SKALE Base Mainnet
eip155:1187947933
Production target — flip via SKALE_CHAIN_ID env
Facilitator: https://facilitator.dirtroad.dev (run by DirtRoad). Sepolia bridged USDC: 0x2e08028E…030bD. Mainnet token addresses are not yet in SKALE's public docs — ask in the SKALE Builders Chat for the current list.

New to x402 in general? See the generic x402 integration guide.

Ship tax-compliant SKALE merchants today

Clone the starter, drop in your AgentTax key, run it. 1,500 calls/mo free, no credit card.