Verify x402 API endpoints before payment. Trust primitive for the agent economy.
PQS (Protocol Quality Standard) is a Certificate Authority for AI agents. Before your agent pays for an API endpoint via x402 micropayments, check if the endpoint is PQS-verified — trusted, attested on-chain, and meeting quality standards.
Think of it as Let's Encrypt for AI Agents.
npm install pqs-verifyconst { verifyEndpoint, shouldPay } = require('pqs-verify');
// Check if an endpoint is trusted
const result = await verifyEndpoint('https://api.example.com/data');
console.log(result.trusted); // true or false
// One-liner: should my agent pay this endpoint?
const safe = await shouldPay('https://api.example.com/data');const { verifyEndpoint } = require('pqs-verify');
const check = await verifyEndpoint('https://api.example.com/signal');
if (check.trusted) {
console.log('Endpoint is PQS-verified');
console.log('On-chain attestation:', check.eas_uid);
// proceed with request/payment
} else {
console.log('NOT verified — do not pay');
}Check PQS trust before sending x402 payment:
const { verifyEndpoint } = require('pqs-verify');
async function payIfTrusted(endpointUrl) {
const check = await verifyEndpoint(endpointUrl);
if (!check.trusted) {
console.log('Blocked: endpoint not PQS-verified');
return;
}
// Safe to pay via x402
const response = await fetch(endpointUrl, {
headers: { 'X-PAYMENT': x402PaymentToken }
});
return response.json();
}Auto-check every endpoint before payment — drop into any agent framework:
const { shouldPay } = require('pqs-verify');
async function agentRequest(url, paymentFn) {
if (!await shouldPay(url)) {
throw new Error(`PQS: ${url} not verified`);
}
return paymentFn(url);
}Equivalent pattern using requests:
import requests
def pqs_verify(endpoint_url):
r = requests.get(
'https://api.smartflowproai.com/pqs/verify',
params={'endpoint': endpoint_url},
timeout=5
)
data = r.json()
return data.get('valid', False)
# Use in your agent's tool
if pqs_verify('https://api.example.com/data'):
# safe to pay
passVerify a single endpoint against PQS CA.
Returns: { trusted, cert, score, tier, eas_uid, raw }
| Field | Type | Description |
|---|---|---|
trusted |
boolean |
Whether the endpoint is PQS-verified |
cert |
object|null |
Certificate details if verified |
score |
number|null |
PQS quality score |
tier |
string|null |
PQS tier (e.g. "standard", "premium") |
eas_uid |
string|null |
On-chain EAS attestation UID |
raw |
object |
Full API response |
Quick boolean: should an agent pay this endpoint?
Returns false on network errors (fail-safe).
Options: { baseUrl, timeout, minScore }
Get all verified endpoints from PQS CA.
Returns: { total, ca_public_key, certs: [...] }
Check PQS CA health status.
Get PQS CA statistics.
| Option | Default | Description |
|---|---|---|
baseUrl |
https://api.smartflowproai.com/pqs |
PQS CA server URL |
timeout |
5000 |
Request timeout in ms |
minScore |
0 |
Minimum PQS score (shouldPay only) |
See verified endpoints and their scores: pqs-leaderboard.pages.dev
MIT