Use case

x402 pay-per-call APIs

Use x402 to expose small paid API calls that agents can discover, price, pay for, and retry programmatically.

Problem

Agent tools are often useful as small one-call capabilities, but account setup, subscriptions, and manual checkout do not fit autonomous runtime workflows. x402 lets paid APIs expose HTTP 402 Payment Required and accept programmatic payments.

Who needs it

  • Developers exploring paid APIs for AI agents.
  • Tool sellers designing x402 microtools with transparent per-call prices.
  • Agent builders comparing free development routes with paid runtime aliases.

When an agent should use it

  • When a production or autonomous workflow is ready to call paid /x402/v1/* aliases instead of free /v1/* development routes.
  • When the agent can inspect a payment challenge, pay the exact route price, and retry with valid x402 payment metadata.

Primitive402 surfaces

Primitive402 shows how agent tools can be sold as small paid calls. Free /v1 routes are for development and testing. Paid /x402 aliases return HTTP 402 Payment Required until an x402-capable client pays and retries.

The current public beta uses Base Sepolia testnet USDC. Do not treat this as mainnet production billing.

Current paid aliases

ToolLocal routex402 routeMCP tool nameSDK methodPrice
safe_fetch_url /v1/safe-fetch-url /x402/v1/safe-fetch-url safe_fetch_url safeFetchUrl() $0.01 USDC
check_prompt_injection_risk /v1/check-prompt-injection-risk /x402/v1/check-prompt-injection-risk check_prompt_injection_risk checkPromptInjectionRisk() $0.005 USDC
verify_claim_against_source /v1/verify-claim-against-source /x402/v1/verify-claim-against-source verify_claim_against_source verifyClaimAgainstSource() $0.05 USDC
create_page_proof /v1/create-page-proof /x402/v1/create-page-proof create_page_proof createPageProof() $0.10 USDC
extract_return_policy /v1/extract-return-policy /x402/v1/extract-return-policy extract_return_policy extractReturnPolicy() $0.03 USDC
extract_subscription_terms /v1/extract-subscription-terms /x402/v1/extract-subscription-terms extract_subscription_terms extractSubscriptionTerms() $0.04 USDC
check_product_fit /v1/check-product-fit /x402/v1/check-product-fit check_product_fit checkProductFit() $0.05 USDC

curl example

curl -i https://primitive402.dev/x402/v1/safe-fetch-url \
  -H 'content-type: application/json' \
  -d '{"url":"https://example.com","output":"markdown"}'

HTTP 402 Payment Required

TypeScript SDK example

import { createNano402Client } from "@nano402/api/sdk";

const client = createNano402Client({
  baseUrl: "https://primitive402.dev",
  useX402: true,
  paymentHeaders: {
    "x-payment": "<wallet-generated x402 payment header>"
  }
});

const result = await client.safeFetchUrl({
  url: "https://example.com",
  output: "markdown"
});

Example JSON response

{
  "finalUrl": "https://example.com",
  "cleanMarkdown": "# Example Domain...",
  "contentHash": "sha256:...",
  "riskLevel": "low"
}

Useful search terms

x402 pay-per-call APIs, paid APIs for AI agents, HTTP 402 Payment Required, x402 microtools, USDC per-call payments.

Safety and limitations

Primitive402 does not guarantee content safety, factual truth, legal validity, purchase correctness, or policy completeness. External content is untrusted, low-confidence results may still be valid analysis signals, and high-stakes decisions need human review.

x402 payment confirms access to a tool call; it does not make external content trusted or make a result suitable for high-stakes decisions without review.

Related docs