x402 Prompt Protection Payments
Parse Agents supports x402 for autonomous agents that need prompt protection before they have a bearer API key. x402 is best for first-call access, marketplace agents, and metered workflows. Use Pro, Team, or Enterprise keys for sustained production volume.
Flow
- Call a billable endpoint without
Authorization. - Read the
402 Payment Requiredresponse and itsaccepts[]payment requirements. - Sign the advertised USDC payment on Base mainnet.
- Retry the identical request with
payment-signature. - Legacy x402 clients may send
x-payment.
Billable endpoints
| Endpoint | Price | Use |
|---|---|---|
POST /v1/parse | $0.005 | Screen untrusted prompts before agent action |
POST /v1/screen-output | $0.003 | Screen generated output before forwarding |
POST /v1/analyze | $0.01 quick, $0.05 standard, $0.15 deep | Media credibility analysis |
POST /v1/evaluate | $0.01 | Prompt quality, safety, latency, and cost evaluation |
POST /v1/chat | $0.005 | Chat with Parse Agents |
The canonical machine-readable pricing manifest is GET /v1/pricing.
Agent retry contract
The 402 body includes the x402 accepts[] object plus Parse Agents retry metadata:
{
"accepts": [],
"retry": {
"method": "POST",
"resource": "https://parsethis.ai/v1/parse",
"header": "payment-signature",
"legacy_header": "x-payment"
},
"payment_context": {
"service": "Parse Agents",
"network": "eip155:8453",
"network_name": "Base mainnet",
"currency": "USDC",
"pricing_url": "https://parsethis.ai/v1/pricing",
"openapi_url": "https://parsethis.ai/openapi.json",
"docs_url": "https://parsethis.ai/docs/x402"
}
}For non-idempotent workflows, send an Idempotency-Key header and reuse it on the paid retry.
TypeScript
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const client = new x402Client().register("eip155:8453", new ExactEvmScheme(account));
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://parsethis.ai/v1/parse", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ prompt: untrustedText }),
});
const decision = await res.json();Never log the private key. Use a funded, scoped wallet for agent payments rather than a primary wallet.