API Docs & Protocol Spec • v2.8.4 • SLA 100/100

Freedom Engine Developer Documentation: HTTP 402, MCP Server & A2A Reference

Integrate zero-registration autonomous payments and deterministic tools into any AI agent in under 60 seconds using HTTP 402 (Bitcoin Lightning L402 or Base/Solana USDC x402), Streamable MCP, or OpenAI-compatible SDKs.

How does Freedom Engine HTTP 402 authentication work for developers?

Send any HTTP request without an API key or account. Freedom Engine returns HTTP 402 Payment Required with both L402 Lightning (WWW-Authenticate macaroon plus BOLT11 invoice) and x402 USDC (PAYMENT-REQUIRED Base and Solana payload) headers. Attach payment proof on retry or deposit once into a 0ms Prepaid Session Pass.

How do AI agents validate payloads and test endpoints for free?

Append ?dryRun=true to any tool route for unlimited zero-cost schema verification and exact Sat/USDC price quotes before paying. New agents can also pass ?freeTrial=true or api_key="free" to run two free executions per IP on the 120B chat router, embeddings, BTC oracle, and Python sandbox.

Technical Specifications, Endpoints & Pricing Matrix

Capability / RouteEndpoint / ProtocolTechnical SummaryRate / Guarantee
Streamable MCP EndpointPOST /mcp45 tools exposed natively0ms schema / pay-per-call
OpenAI Chat & EmbeddingsPOST /v1/chat/completions120B LPU & 1536d vectors10 Sats ($0.0094 USDC)
Universal Natural AskPOST /api/v1/askAuto-classifies intent to tool5–60 Sats
Prepaid 0ms Session PassPOST /api/v1/router/topupReusable m2m-pass-<hex> tokenFrom 50 Sats deposit
Google A2A GatewayPOST /a2aSigned JSON-RPC 2.0 agent tasksAtomic 100/100 SLA

Quickstart Code & Pre-Flight Dry-Run Example

Test payload validation for 0 Sats using ?dryRun=true or authenticate immediately via L402, x402, or a 0ms Prepaid Session Pass. Primary endpoint: /openapi.json (0–60 Sats / $0.000–$0.056).

curl -s "https://m2mfreedom.com/api/v1/router/tools/oracle?dryRun=true"

# Install MCP Server or Python SDK
npx -y freedom-m2m-mcp-server
pip install freedom-m2m==2.8.4

Architecture Notes & Operational Guarantees

Authentication Flow: Standard REST, OpenAI SDK drop-in, Streamable HTTP MCP (/mcp), and Server-Sent Events (/sse) share a unified clearinghouse ledger so one Prepaid Session Pass funds all 45 tools.

Pre-Flight Input Validation: Every tool validates required URLs, target parameters, and payload bounds prior to generating a Lightning invoice or USDC quote, preventing wasted micro-payments on malformed requests.

Frequently Asked Questions

Can I use the official OpenAI, Anthropic, or Gemini SDKs without changes?

Yes. Point your SDK base URL to https://m2mfreedom.com/v1, /v1/messages, or /v1beta and pass your m2m-pass-<hex> token (or "free" for trial executions) as the API key.

Where is the machine-readable OpenAPI 3.1 schema hosted?

Download the full live OpenAPI 3.1 specification at https://www.m2mfreedom.com/openapi.json or inspect /.well-known/mcp.json and /.well-known/agent-card.json.

What protects agents from losing funds on upstream errors?

Atomic Token Protection ensures L402 macaroons, x402 signatures, and Prepaid Pass credits are never consumed unless the gateway delivers a verified HTTP 200 OK response.

Explore All Freedom Engine Protocols & AI Agent APIs