Skip to main content
AgentTax
Integration · SKALE Network

Tax compliance for gasless x402 on SKALE

SKALE is gasless. Sub-cent x402 payments are finally profitable — which means your 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.

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 100/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.

How it works

01
Get your API key
Sign up at agenttax.io — free tier, no credit card. 100 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 + tax breakdown per jurisdiction — instant 1099-DA-ready record.
03
Remit tax from gross at filing
You collected full payment — gasless. AgentTax has the obligation logged per state. At filing time, the data is already 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 } 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);

app.use("*", paymentMiddleware(
  {
    "GET /paid": {
      accepts: [{
        scheme: "exact",
        network: "eip155:324705682",           // SKALE Europa mainnet
        payTo: process.env.RECEIVING_ADDRESS,
        price: {
          amount: "10000",                      // 0.01 bridged USDC (6 decimals)
          asset: process.env.PAYMENT_TOKEN_ADDRESS,
        },
      }],
    },
  },
  new x402ResourceServer(facilitatorClient)
    .register("eip155:324705682", 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?.buyer_state,
      },
    });
  } catch {
    return c.json({ data: "your paid resource", agenttax: { error: "record_failed" } });
  }
});

Example response

{
  "success": true,
  "sales_tax": {
    "taxable": true,
    "amount": 0.00063,
    "state_tax": 0.00063,
    "local_tax": 0,
    "combined_rate": 0.0625,
    "buyer_state": "TX",
    "classification_basis": "digital_service",
    "advisories": [
      "TX §151.351: 80% of digital services taxable (20% statutory exemption)"
    ]
  },
  "confidence": { "score": 95, "level": "high" },
  "transaction_id": "txn_skale_abc123"
}

SKALE chain config

Chain ID: 324705682
Network: eip155:324705682 (SKALE Europa mainnet)
Facilitator: https://facilitator.dirtroad.dev
Token: Bridged USDC (0x2e08028E3C4c2356572E096d8EF835cD5C6030bD)
Gas: Free. Always.

Ship tax-compliant SKALE merchants today

Clone the starter repo, drop in your AgentTax API key, and run it. 100 calls/month free — no credit card.