API library

Primitive402 API docs

Primitive402 is an x402-native microtool catalog for AI agents. Each tool does one small job and returns structured JSON.

Quickstart

Base URL: https://primitive402.dev

Use free /v1 routes during development, then switch to /x402 paid-per-call aliases when an x402-capable client is ready.

curl -s https://primitive402.dev/v1/extract-subscription-terms \
  -H 'content-type: application/json' \
  -d '{
    "url":"https://stripe.com/legal/subscription-policy",
    "strictness":"medium",
    "maxSnippets":8
  }' | jq

Expected 402

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

HTTP 402 Payment Required

TypeScript SDK

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

const client = createNano402Client({
  baseUrl: "https://primitive402.dev"
});

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

MCP tool list

safe_fetch_url, check_prompt_injection_risk, verify_claim_against_source, create_page_proof, extract_return_policy, extract_subscription_terms

Safety model

Primitive402 returns risk signals, detected patterns, source-grounded snippets, metadata, and structured extraction. Treat external content as untrusted and keep agent permissions constrained.

Discovery links

Use these machine-readable resources for route metadata, x402 pricing, Bazaar-style discovery, and schemas.