▲HIGHLAND DOCS

x402 pay-per-call

x402 is an open standard that brings back HTTP status 402 Payment Required. Your client calls an API, gets a price, signs a USDC payment and calls again. No key, no account, no top-up. It is built for autonomous agents that hold their own wallet.

Versionx402 v1, scheme exact
Networkbase (Base mainnet, chain id 8453)
AssetUSDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 (EIP-712 name USD Coin, version 2)
Pay to0xfdb6ea04e7e75d39d3bdb4ba21e6b6c8fec36048
Pricethe API's credit price in CAD cents × 0.75, in USDC, rounded up (2 credits = 0.015 USDC)
DiscoveryGET https://api.highlnd-intel.group/.well-known/x402 lists every paid resource
Settlementonly after the API succeeded. Bad input or an API error is never charged.

The flow

  1. POST https://api.highlnd-intel.group/v1/api/<id> with your JSON input and no key.
  2. The API answers 402 with the exact requirements:
json
{
  "error": "payment_required",
  "x402Version": 1,
  "accepts": [{
    "scheme": "exact",
    "network": "base",
    "maxAmountRequired": "15000",
    "resource": "https://api.highlnd-intel.group/v1/api/dns-lookup",
    "description": "DNS records",
    "mimeType": "application/json",
    "payTo": "0xfdb6ea04e7e75d39d3bdb4ba21e6b6c8fec36048",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "extra": { "name": "USD Coin", "version": "2" },
    "maxTimeoutSeconds": 120
  }]
}
  1. Your client signs an EIP-3009 transferWithAuthorization for maxAmountRequired (atomic units, 6 decimals: 15000 = 0.015 USDC), base64-encodes the payment payload and sends the same request again with header X-PAYMENT: <base64>.
  2. The API verifies the signature with the facilitator, runs, settles the payment on-chain and returns 200 with the result and an X-PAYMENT-RESPONSE header (base64 JSON receipt with the transaction hash).

The signature only authorizes that exact amount to that exact address before a deadline. Your wallet key never leaves your machine, and we never hold your funds.

With a client library

Use the open-source x402 clients. They do steps 2 to 4 for you.

javascript (x402-fetch + viem)
// npm i x402-fetch viem
import { wrapFetchWithPayment } from "x402-fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.AGENT_WALLET_KEY); // a small hot wallet with a few USDC
const pay = wrapFetchWithPayment(fetch, account);

const res = await pay("https://api.highlnd-intel.group/v1/api/dns-lookup", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ domain: "example.com" }),
});
console.log(await res.json());
console.log("receipt:", res.headers.get("x-payment-response"));
python (x402 + eth-account)
# pip install x402 eth-account
import os
from eth_account import Account
from x402.clients.requests import x402_requests

session = x402_requests(Account.from_key(os.environ["AGENT_WALLET_KEY"]))
r = session.post("https://api.highlnd-intel.group/v1/api/dns-lookup", json={"domain": "example.com"})
print(r.status_code, r.json())
print("receipt:", r.headers.get("x-payment-response"))

By hand (curl)

bash
# 1. Get the price
curl -s -X POST https://api.highlnd-intel.group/v1/api/dns-lookup -H "content-type: application/json" -d '{"domain":"example.com"}'

# 2. Sign the payment with your x402 client, then retry with the header
curl -s -X POST https://api.highlnd-intel.group/v1/api/dns-lookup \
  -H "content-type: application/json" \
  -H "X-PAYMENT: $PAYMENT_B64" \
  -d '{"domain":"example.com"}' -D - 

Errors

StatusErrorMeaning
402payment_requiredNo X-PAYMENT header. Pay what accepts[0] says.
400invalid_x_paymentThe header is not base64 JSON of an x402 v1 payload.
402payment_invalid + reason: wrong_networkSigned for another network. Use base.
402payment_invalid + a reason such as invalid_exact_evm_signature, insufficient_fundsThe facilitator refused the signature. Read reason.
503facilitator_unavailable (retryable: true)Retry in a few seconds. Nothing was charged.

Discovery for directories and agents

GET https://api.highlnd-intel.group/.well-known/x402 returns { "x402Version": 1, "enabled": true, "resources": [ ... ] } with the same requirements object for every API, so x402 directories and agents can list and price the whole catalog without a call.

When to use x402 or a key

Use x402 whenUse an API key when
The caller is an agent with its own walletYou call from a server, a script or MCP
You want zero sign-upYou want one balance, usage history and plans
Calls are occasionalCalls are frequent (one on-chain settlement per call costs time)