NonagonLink — AI Agent Developer Guide
For EVM inline payments on proxy / flexible_proxy with an actual upstream GET, the gateway buffers the complete 2xx response before sending payment and returns the body only after receipt confirmation. Upstream failures and the pre-send 429 limits (payer settlement failures, payer concurrency, provider concurrency) return gateway paymentStatus: not_paid and doNotPayAgain: false. Every 429 is decided after acquiring the authorization and abandons it before this response; if another request is executing the same authorization, a 409 unknown / doNotPayAgain: true comes first. If abandonment cannot be confirmed, the outcome remains unknown / doNotPayAgain: true. Sign a new authorization; never execute the old authorization yourself. TX_TIMEOUT after submission withholds the body and returns unknown / doNotPayAgain: true. The MCP client may still display unknown; inspect the gateway outcome and avoid duplicate payments.
Integration guide for calling NonagonLink paid APIs with USDC from AI agents
1. Overview
NonagonLink is an agentic payment gateway compliant with the x402 protocol (Coinbase). AI agents can use paid APIs in the following two ways.
| Method | Best suited for | Required implementation |
|---|---|---|
| MCP (recommended) | MCP-capable AI such as Claude / GPT-4 | MCP server connection settings only |
| Direct x402 protocol integration | Custom agents / SDK embedding | Integration of @x402/fetch |
2. Prerequisites
- A Solana wallet for payments (USDC / SOL will be paid from this wallet). Use mainnet for production, or devnet to try things out at no cost
- USDC token holdings (production = real USDC on mainnet / testing = free airdrop on devnet)
- Node.js >= 22.12.0 (for the MCP method)
Preparing a Solana wallet and USDC for payments (the example below uses devnet for testing)
# Generate a keypair with the Solana CLI
solana-keygen new --outfile ~/.config/solana/devnet.json --no-bip39-passphrase
# Check the public key
solana-keygen pubkey ~/.config/solana/devnet.json
# Airdrop devnet SOL (for transaction fees)
solana airdrop 2 --url devnet
# devnet USDC is distributed automatically in the NonagonLink test environment3. Method A: Connect via NonagonLink (recommended)
MCP (Model Context Protocol) is a standard protocol that lets AI agents such as Claude / GPT-4 call external tools. NonagonLink provides the NonagonLink MCP server, allowing AI agents to call paid APIs transparently.
3-1. Setup
See the MCP setup guide for details.
For Claude Code:
.claude/settings.json:
{
"mcpServers": {
"nonagon-link": {
"command": "npx",
"args": ["tsx", "apps/nonagon_link/src/mcp/server.ts"],
"cwd": "/path/to/nonagon_link",
"env": {
"NONAGON_PRIVATE_KEY": "<private key of the Solana wallet used for payments (Base58)>",
"NONAGON_NETWORK": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"NONAGON_LINK_BASE_URL": "https://api.nnglink.ai",
"NONAGON_PAY_TO": "8yXpNyyPg9iGdMST8BRyz7HEJVbQG81VP6kHBCKXrdH8",
"LOG_LEVEL": "info"
}
}
}
}Even when using HTTP stream, the runtime binds only to 127.0.0.1, so treat it as intended for local HTTP clients on the same machine. Do not expose it as a public endpoint over the network.
In HTTP stream mode, setting MCP_AUTH_TOKEN is required. Set MCP_AUTH_TOKEN on the server side, and always attach Authorization: Bearer <MCP_AUTH_TOKEN> on the client side as well.
Use a CSPRNG-generated secret of at least 32 bytes for MCP_AUTH_TOKEN. The published configuration examples only accept values of at least 43 base64url characters or at least 64 hex characters.
3-2. Available tools
pay_and_call
GET listings take query (requires @nonagon-link/mcp 0.3.3 or later; older versions drop it silently; an object of strings, finite numbers or booleans); POST takes body (any JSON object / array / scalar / null). Map get_listing httpMethod to method. GET body, nonempty POST query, duplicate decoded keys and collisions with existing URL keys are rejected before any request; POST query:{} is treated as omitted. Existing URL encoding is preserved; query is limited to 64 parameters and 4096 serialized characters including existing values. Example: {"method":"GET","query":{"query":"日本語 & + %","page":0,"include":false}}. Only an unsigned GET402 whose final URL has zero query parameters is checked against an available queryParams schema before signing. If schema is absent, invalid, unsupported or over budget, validation is skipped and the existing payment policy still applies; payment proceeds as before. Nonempty queries use the gateway validation, including page-size clamping.
not_paid means the MCP can determine that payment was not executed. Every executed tool result includes boolean paymentSignatureSent; not_paid is not synonymous with unsigned. Classifying a signed GET422 as not_paid requires NONAGON_LINK_BASE_URL to be configured with an official (nnglink.ai / *.nnglink.ai) or local (localhost / 127.0.0.1) host, the same origin, the exact /api/proxy/{providerSlug}/{listingSlug} route, a complete JSON body within 8 KiB with code SCHEMA_VALIDATION_FAILED / QUERY_TOO_LARGE / SCHEMA_UNSUPPORTED, and no PAYMENT-RESPONSE, X-PAYMENT-RESPONSE (including the saved receipt) or X-Proxy-Payment-Id. This is the configured gateway's rejection before payment execution; correct query and retry. Any other signed failure is also not_paid when the configured gateway (same host, origin and exact proxy route conditions as above) returns X-Nonagon-Payment-Status: not_paid and X-Nonagon-Do-Not-Pay-Again: false with none of the three receipts above (@nonagon-link/mcp 0.3.5 or later; older versions keep showing unknown). The body paymentStatus is never used. Retry with a new signature at most once and stop if it fails again; do not execute the old authorization yourself. For EVM retain authorization (network / asset / from / nonce / validBefore): it remains valid until validBefore. A signed not_paid result does not independently prove on-chain non-execution. Other signed failures and communication failures retain paid / unknown according to the receipt; on unknown do not retry automatically and check authorizationState(from, nonce).
{
"success": false,
"error": "API returned 422",
"httpStatus": 422,
"paymentStatus": "not_paid",
"paymentInfo": null,
"authorization": {
"network": "eip155:137",
"asset": "<token contract>",
"from": "<your wallet>",
"nonce": "<signed nonce>",
"validBefore": "<expiry>"
},
"paymentSignatureSent": true,
"queryErrorHint": "The configured gateway rejected the query before executing payment; a signed request was sent. Correct the query and retry. For EVM, retain the authorization lookup fields; the authorization remains valid until validBefore."
}Pays a paid API and retrieves data: Solana USDC, plus JPYC / TEST_JPYSC with an EVM key and NONAGON_EVM_PAY_TO, and EVM USDC only when MCP_MAX_PAYMENT_EVM_USDC_CAP is set (see the MCP setup guide).
| Parameter | Type | Required | Description |
|---|---|---|---|
proxyUrl | string (URL) | Required | URL of the API to call (HTTPS only) |
method | "GET" | "POST" | Optional | HTTP method (default: GET) |
query | Record<string, string | number | boolean> | Optional / 任意 | GET query; POST query:{} is omitted |
body | object / array / scalar / null | Optional | Body of the POST request |
maxPaymentUsdc | number | Required | Maximum Solana USDC this call may pay (greater than 0, up to 0.100 by default; the ceiling is MCP_MAX_PAYMENT_USDC_CAP). Not used for EVM USDC. If the amount requested by the 402 exceeds this, an error is returned without paying |
maxPaymentJpy | number | Optional | Maximum for yen-denominated listings (JPYC / TEST_JPYSC): greater than 0, up to MCP_MAX_PAYMENT_JPY_CAP (100 by default), at most 4 decimals. Without it a yen 402 is not paid. Needs NONAGON_EVM_PRIVATE_KEY and NONAGON_EVM_PAY_TO |
maxPaymentEvmUsdc | number | Optional | Maximum for EVM USDC listings: greater than 0, up to MCP_MAX_PAYMENT_EVM_USDC_CAP, at most 6 decimals. EVM USDC is paid only when that cap is set, and only with this argument |
⚠️ EVM payments (JPYC, EVM USDC): an EVM payment is a signed EIP-3009 authorization, and any third party that receives it (such as the host you call) can execute it on-chain itself. The money can only go to the treasury in NONAGON_EVM_PAY_TO, but you then get no service and no payment record. There is no session or daily total limit: keep each cap as low as you need, keep the EVM wallet balance small, and do not pay_and_call URLs you do not trust. When paymentStatus is unknown, do not retry; check authorizationState(from, nonce) on the token contract.
Usage example (request to Claude):
Please call the following API with pay_and_call:
- URL: https://api.nnglink.ai/api/proxy/weather-api/current
- Method: POST
- Body: { "city": "Tokyo" }
- Payment limit: 0.05 USDCExample response:
{
"success": true,
"data": {
"city": "Tokyo",
"temperature": 22,
"condition": "sunny"
},
"paymentSignatureSent": true,
"paymentStatus": "paid",
"paymentInfo": {
"currency": "USDC",
"amount": "0.01",
"amountUsdc": "0.01",
"txSignature": "5xKt...",
"network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"payer": "<your wallet>",
"paidAt": "2026-10-05T00:00:00.000Z"
}
}paymentStatus is paid, not_paid or unknown. On unknown (a signed payment was sent but the result is not confirmed), do not retry automatically: a retry can pay twice. For EVM payments, check authorizationState(from, nonce). For yen tokens (JPYC / TEST_JPYSC), amount is in that currency and amountUsdc is null.
For an unsigned result, confirm paymentSignatureSent:false together with paymentStatus being not_paid (a free API or a reused token, for example). paymentInfo can be null while paymentStatus is unknown (an EVM payment whose result is unknown), so a null paymentInfo alone does not mean nothing was paid.
get_active_tokens
Retrieves summaries of currently valid masked tokens and their remaining validity time.
The public response returns only summaries containing maskedToken; raw token values are never exposed.
Example response:
{
"tokens": [
{
"maskedToken": "agt_abcd...mnop",
"proxyUrl": "https://api.nnglink.ai/api/proxy/weather-api/current",
"expiresAt": "2026-05-11T12:00:00Z",
"remainingMinutes": 45
}
]
}search_listings
Searches paid APIs and returns a summary of each candidate (price, payment compatibility, settled-payment ratings, health, contract, decision gaps, and providerId / listingId). From @nonagon-link/mcp 0.3.7 it no longer returns the call target (proxyUrl) or how to call it; get them with get_listing for the listing you choose.
Note: To use this tool, the MCP server must be configured with NONAGON_LINK_BASE_URL (e.g. https://api.nnglink.ai).
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Optional | Search terms. Give short words for the kind of data, its subject area, or its source, separated by spaces (up to 200 characters; the first 8 words are used). Listings whose name, description, or category contains any of the words are returned, those matching more words first. Date / number only words, single-character alphanumerics, and symbol-only words are not used and are reported with a reason in query.ignored (if every word is dropped, results are not narrowed). With no results, hint explains how to search again. Pass dates and other values to the API as call parameters after choosing a listing |
category | string | Optional | Filter by category (up to 40 characters) |
chain / networkId | string | Optional | Filter by payment chain or CAIP-2 network |
currency / maxPrice | string / number | Optional | Currency and per-call budget; currency is required with maxPrice |
health | string | Optional | Filter by healthy, unhealthy, or unknown |
minRatingCount | number | Optional | Minimum settled-payment rating count |
payableViaMcpOnly | boolean | Optional | Return only listings payable on this MCP server's configured network |
sort / order | string | Optional | Defaults to decision_readiness / desc |
limit | number | Optional | Number of results (1–10, default 5) |
decision_readiness ranks pre-purchase inspectability. It does not guarantee response correctness or data quality.
get_listing
Pass the providerId and listingId of one listing chosen from search_listings. It fetches that listing's OpenAPI once and returns the proxyUrl, httpMethod and funnelAttribution to pass to pay_and_call, how to call it (parameters, querySchema, requestBodySchema, requestGuide, queryExample, requestBodyExample), response samples and schema, and the successor listing (replacement) (@nonagon-link/mcp 0.3.7 or later; requestBodyExample from 0.3.9). The response, request and query gaps (decisionGaps) are returned here.
When it fails (not public, sunset, or a fetch error), it returns how to pick the next candidate: remember the tried listingId, choose another summary, or call search_listings again with the same filters and a larger limit. From @nonagon-link/mcp 0.3.10, the exception is HTTP 429 / 503 (busy): do not pick another listing; wait the returned number of seconds and call get_listing again once for the same listing. If it is still busy, stop and report (the limit is shared by all listings, so another one returns the same). Also from @nonagon-link/mcp 0.3.10, when the listing is sunset and has a successor, it returns the successor's listingId: call get_listing with the same providerId and that listingId.
| Parameter | Type | Required | Description |
|---|---|---|---|
providerId | string (UUID) | Required | The providerId returned by search_listings |
listingId | string (UUID) | Required | The listingId returned by search_listings |
get_payment_history
Fetches the payment history for this MCP server's wallets (NONAGON_PRIVATE_KEY, plus NONAGON_EVM_PRIVATE_KEY when set), including inline payments made via pay_and_call. History is scoped to the wallet, not the session.
With an EVM wallet configured, both wallets' histories are merged newest first and each row carries wallet (solana / ethereum). wallets reports each wallet's result (status: ok / error); if one wallet fails, the other wallet's rows are returned with partial: true. For EVM payments a missing history row does not prove the authorization was not executed (on unknown, check authorizationState(from, nonce)).
Note: To use this tool, the MCP server must be configured with NONAGON_LINK_BASE_URL.
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | number | Optional | Number of records (1–50, default 10) |
status | string | Optional | Filter by payment status (settled / authorized / failed / refunded, etc.) |
get_spending
Fetches cumulative spending (settled + authorized) for this MCP server's wallets by period, with a per-currency breakdown. Useful for budget tracking.
The top-level total / count / byStatus / byCurrency / period / from are the Solana wallet's values, and total / count / byStatus are USDC only. With an EVM wallet configured the response also has wallets (each wallet's byCurrency) and assets (one entry per wallet × currency). Amounts are never added across wallets or currencies; read assets for JPYC and for the EVM wallet. If one wallet fails, the response has partial: true and only the other wallet's values.
Note: To use this tool, the MCP server must be configured with NONAGON_LINK_BASE_URL.
| Parameter | Type | Required | Description |
|---|---|---|---|
period | string | Optional | Aggregation period: day (24h) / week (7d) / month (30d) / all (default) |
4. Method B: Direct x402 protocol integration
4-1. Overview of the x402 protocol
x402 is a micropayment protocol that uses the HTTP 402 (Payment Required) response.
Agent → Provider API → 402 Payment Required (PaymentRequirements)
Agent → Signs a USDC transfer transaction offline on Solana
Agent → Provider API + X-PAYMENT-* headers
Provider → NonagonLink /verify → verification OK
Provider → Returns response
Provider → NonagonLink /settle → submitted to the blockchain4-2. Integration using @x402/fetch
import { wrapFetchWithPayment, x402Client } from '@x402/fetch'
import { ExactSvmScheme } from '@x402/svm'
import { createKeyPairSignerFromBytes } from '@solana/kit'
import bs58 from 'bs58'
// 1. Initialize the Solana signer (private key of the payment wallet)
const privateKeyBytes = bs58.decode(process.env.NONAGON_PRIVATE_KEY!)
const signer = await createKeyPairSignerFromBytes(privateKeyBytes)
// 2. Initialize the x402 client
const client = new x402Client()
client.register(
'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp', // mainnet (devnet is solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1)
new ExactSvmScheme(signer)
)
// 3. Create a payment-enabled fetch
const payFetch = wrapFetchWithPayment(fetch, client)
// 4. Call the API (if a 402 is returned, it automatically pays and retries the request)
const response = await payFetch(
'https://api.nnglink.ai/api/proxy/weather-api/current',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ city: 'Tokyo' }),
}
)
const data = await response.json()
console.log(data)Note for @x402/core 2.29 and later: x402Client applies spendControls by default. It pays only the SDK's default assets (such as USDC), capped at $1 per payment. The Solana USDC example above (0.1 USDC or less per call) works with the defaults. To buy EVM listings (2 to 10 USDC, or JPYC), register ExactEvmScheme from @x402/evm and set the assets and caps yourself.
client.setSpendControls({
// Per-payment cap for default assets (USDC), in US dollars
maxAmountPerPayment: '$10',
// Add assets that are not defaults (JPYC). The cap is an integer in the smallest unit (JPYC has 18 decimals: 100 JPYC = 100 × 10^18)
allowedAssets: [
{ network: 'eip155:137', asset: '0xe7c3d8c9a439fede00d2600032d5db0be71c3c29', maxAmountPerPayment: '100000000000000000000' },
],
})allowedAssets adds to the default assets; it does not limit payments to the listed ones. Also, maxAmountPerPayment applies to every recipient this client pays. To restrict which assets or recipients (payTo) you pay, add your own policy with client.registerPolicy. Do not copy payTo from a 402 you received: replace it with NonagonLink's public value from the quick-start table in /docs/mcp. Add a line for every network you use (including Solana); this policy drops every payment on a network you did not list.
const allowed = new Set([
// network|asset|payTo (EVM addresses in lowercase; Solana addresses are case-sensitive, keep them as written)
'eip155:137|0xe7c3d8c9a439fede00d2600032d5db0be71c3c29|<verified NonagonLink payTo>',
])
// Lowercase EVM addresses only (lowercasing Solana would let a different address that differs only in case through)
const norm = (network, value) => (network.startsWith('eip155:') ? value.toLowerCase() : value)
client.registerPolicy((_version, requirements) =>
requirements.filter((r) => allowed.has(`${r.network}|${norm(r.network, r.asset)}|${norm(r.network, r.payTo)}`)),
)4-3. Facilitator API reference
GET /api/facilitator/supported
Returns information about supported blockchains and tokens.
Response:
{
"x402Version": 2,
"kinds": [
{
"scheme": "exact",
"network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"feePayer": "<facilitator fee payer public key>"
}
]
}POST /api/facilitator/verify
Verifies the Agent's partially signed transaction and issues a settleToken.
Request: Conforms to the x402 protocol specification (HMAC-SHA256 signature + nonce)
Response:
{
"valid": true,
"settleToken": "<JWT>"
}POST /api/facilitator/settle
Co-signs the verified transaction, submits it to the blockchain, and finalizes the payment.
Request: settleToken + HMAC-SHA256 signature
Response:
| Field | Description |
|---|---|
success | true (payment settled) |
transaction | Solana transaction signature |
network | e.g. solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp |
payer | Agent wallet address |
accessToken | Issued access token (agt_ format). Treat as a secret — never log it |
accessTokenExpiresAt | Access token expiry (ISO 8601) |
5. Searching for APIs
5-1. Listing search API
GET /api/listings?category=weather&sort=price_usdc&order=asc&limit=10| Parameter | Description |
|---|---|
q | Keyword search (space-separated words; a listing matches if its name, description, or category contains any word, ranked by the number of matched words) |
category | Filter by category |
chain / networkId / currency | Filter by payment chain, CAIP-2 network, or currency |
maxPrice | Maximum price in the selected currency; currency is required |
health / minRatingCount | Filter by current health and settled-payment rating evidence |
sort | Sort by update time, price, name, rating, uptime, or decision_readiness (default: updated_at) |
order | Sort order (asc / desc, default: desc) |
limit | Number of results (default: 20, max: 100) |
offset | Pagination (default: 0) |
Response:
{
"total": 42,
"limit": 20,
"offset": 0,
"listings": [
{
"id": "uuid",
"name": "Weather API",
"description": "API that returns the current weather",
"category": "weather",
"endpointUrl": "https://api.nnglink.ai/api/proxy/weathercorp/weather-api",
"httpMethod": "POST",
"priceUsdc": "0.010000",
"listingType": "proxy",
"timeoutSeconds": 60,
"providerId": "uuid",
"providerName": "WeatherCorp",
"hasSchema": true,
"hasExample": true,
"hasResponseSchema": true,
"hasResponseSample": true,
"coverage": null,
"updatedAt": "2026-05-10T09:00:00Z",
"openapiUrl": "/api/providers/<providerId>/listings/<id>/openapi"
}
]
}Errors:
| HTTP | code | Meaning | What to do |
|---|---|---|---|
| 400 | QUERY_TOO_LONG | The search words are too long | Do not wait; shorten q |
| 429 | RATE_LIMIT_EXCEEDED | Per-source request limit (60-second window) | Wait the Retry-After seconds, then retry once |
| 503 | PUBLIC_DB_BUSY | Public reads are busy | Wait the Retry-After seconds (1), then retry once |
| 503 | SEARCH_TIMEOUT | Matching the search words did not finish in time | Do not wait; use fewer or shorter words |
The provider public profile, listing OpenAPI / changelog, /openapi.json and /.well-known/x402 also return 429 RATE_LIMIT_EXCEEDED and 503 PUBLIC_DB_BUSY with Retry-After. From @nonagon-link/mcp 0.3.10, the search_listings / get_listing tools turn a 429 / 503 (except the search_listings 503 SEARCH_TIMEOUT) into the number of seconds to wait (1-60, 5 when Retry-After is missing or not a whole number of seconds) and never retry by themselves. Earlier versions return it as a plain failure.
5-2. Provider public information API
GET /api/providers/{id}/publicRetrieves the Provider's public profile and the list of Listings it offers.
6. Calling the Proxy API
When calling a Provider API through the NonagonLink proxy:
POST /api/proxy/{providerSlug}/{listingSlug}- Authentication: x402 protocol (automatic payment) or a pre-obtained access token
- The Provider's API Key is injected server-side by NonagonLink (never exposed to the Agent)
- SSRF protection: private IPs / loopback are automatically rejected
7. Security considerations
Private key management
- Manage
NONAGON_PRIVATE_KEYvia environment variables and never hardcode it in code - Use Secrets Manager or similar in CI/CD
USDC balance
- Confirm you have a sufficient USDC balance before paying
- If the balance is insufficient, a 402 response is returned
Network
- devnet: for testing (free USDC)
- mainnet: for production (real USDC)
- Be careful not to mix up environments
8. Error codes
| HTTP | Code | Description |
|---|---|---|
| 402 | PAYMENT_REQUIRED | USDC payment required |
| 401 | UNAUTHORIZED | Authentication failed / invalid token |
| 403 | FORBIDDEN | Insufficient permissions |
| 404 | NOT_FOUND | Listing / Provider not found |
| 422 | NONCE_EXPIRED | nonce expired (5 minutes) |
| 429 | RATE_LIMITED | Rate limit exceeded |
| 502 | PROXY_PROVIDER_ERROR | The Provider API returned an error |
| 503 | SERVICE_UNAVAILABLE | Service temporarily unavailable |
| 503 | EVM_NATIVE_BALANCE_INSUFFICIENT | Native gas balance is insufficient — our wallet that pays the EVM transaction fee (gas) is short of the network native coin (POL on Polygon, ETH on Ethereum networks). This is not a shortage of the USDC / JPYC you pay with |
| 503 | EVM_NATIVE_READINESS_UNAVAILABLE | Native gas readiness is unavailable — we cannot confirm the native coin (gas) readiness on our side |
| 503 | EVM_GAS_LIMIT_EXCEEDED | Estimated gas exceeds the supported limit — the estimated amount of gas is above the supported limit (300,000 gas). This is a different error from GAS_LIMIT_EXCEEDED, which is about the USD limit on the gas cost |
| 503 | EVM_TRANSACTION_ESTIMATE_UNAVAILABLE | Gas estimation is unavailable — the gas for the transfer transaction cannot be estimated |
The four EVM_ errors above are rejections made before a nonce is issued or before anything is sent on-chain, when we cannot pay or estimate the EVM transaction fee (gas). In the HTTP response JSON, their error field is exactly the English text at the start of each row in the table. For a new request before nonce issuance, if the payment option (network × currency) is turned off, 409 PAYMENT_OPTION_DISABLED is returned before any of these.
Do not decide that nothing was paid from the error code alone. With pay_and_call, look at paymentStatus. On unknown, do not treat success: false or paymentInfo: null as unpaid, and do not pay again automatically. For EVM, if you hold the signed from / nonce / validBefore or a tx hash, check the receipt of that same tx and authorizationState(from, nonce) (keep checking whether the authorization was used even after validBefore has passed). If you do not hold them, do not pay again; contact the operator.
9. SDKs and reference links
| Resource | URL |
|---|---|
| x402 protocol specification | https://www.x402.org |
| @x402/fetch (Agent SDK) | https://www.npmjs.com/package/@x402/fetch |
| @x402/svm (Solana) | https://www.npmjs.com/package/@x402/svm |
| MCP specification | https://modelcontextprotocol.io |
| MCP setup guide | /docs/mcp |