← LinkedIn demo

AILANG×blog.cloudflare.com

AI agent-ready generated 2026-05-14
agent-ready privacy portable

blog.cloudflare.com scored 4/10 on agent-ready.

The radar shows AILANG-readiness across three commercial concerns. High means blog.cloudflare.com is already strong there; low means AILANG could meaningfully help.

Why agent-ready scored 4/10
  • Page references /.well-known/agent.json — the A2A agent card discovery endpoint. Worth only 1pt: it's bleeding-edge (A2A protocol new in 2026), no commercial site has adopted it yet — keep it as a moonshot bonus, not a baseline expectation.
  • Page references /openapi.json, /openapi.yaml, or an OpenAPI schema URL.
  • Page references an MCP endpoint such as /mcp/ or /mcp/sse.
  • Page links to public API documentation, Swagger UI, or ReDoc.
  • Page mentions webhooks, callback URLs, or event subscriptions — the most agent-callable backend pattern.
  • Page documents rate limits, throttling, or 429 handling — agents need to know how to back off.
  • Page references Server-Sent Events, text/event-stream, or a streaming endpoint — agents that read incrementally land here.
  • Page mentions a sandbox, test mode, or test environment — lets agents practise against fake state before touching production.
  • Page documents OAuth, JWT, bearer tokens, API keys, or access tokens — agents can't call the API without knowing how to authenticate.
  • Page mentions idempotency, idempotency-key, or idempotent requests — agents need this to retry safely.
  • Page mentions AG-UI (Agent-User Interaction Protocol) — streams 16 typed lifecycle/text/tool/state events from agent backend to frontend over SSE or WebSocket.
  • Page mentions x402 (Coinbase's signed crypto payment payloads) or Cloudflare's pay-per-crawl (crawler-price header for AI-crawler monetisation). Both revive HTTP 402 for agents — Cloudflare joined the x402 Foundation, so they're one umbrella signal.
  • Page mentions AP2 (Agent Payments Protocol) — Google + Mastercard + 60 orgs. Cryptographically signed Mandates (Intent + Cart) authorise agents to spend on a user's behalf with price/timing/condition bounds.
  • Page mentions UTCP (Universal Tool Calling Protocol) — MCP alternative. Tools described in a JSON UTCPManual, called via their native protocols (HTTP/gRPC/CLI).

Full breakdown ↓ · View rubric ↗

Developers, content creators, publishers, and website operators who need to implement standardized machine-to-machine payment protocols for web resources and automated agents.

Cloudflare and Coinbase are launching the x402 Foundation and integrating support for the x402 protocol. This initiative aims to standardize machine-to-machine payments on the web, enabling automated agents to transact directly for digital resources. The protocol defines how clients and servers negotiate payments, including a new deferred payment scheme for flexible settlement, facilitating monetization for content providers and service operators.
x402 protocol Coinbase Cloudflare HTTP 402 response code Agents SDK Deferred payment scheme

What AILANG Parse sees on blog.cloudflare.com

Structural extraction — the same content an AI agent would consume from this page.

0 headings6 images6 lists0 tables9 linksHTML parsing by AILANG Parse

1 section — page skeleton

1 footer

6 images

facebookXlinkedinyoutubeinstagramPrivacy Options

6 list items

Getting Started [Free plans](https://www.cloudflare.com/plans/free/) [For enterprises](https://www.cloudflare.com/enterprise/) [Compare plans](https://www.cloudflare.com/plans/) [Get a recommendation](https://www.cloudflare.com/about-your-website/) [Request a demo](https://www.cloudflare.com/plans/enterprise/demo/) [Contact Sales](https://www.cloudflare.com/plans/enterprise/contact/) Resources [Learning Center](https://www.cloudflare.com/learning/) [Analyst reports](https://www.cloudflare.com/analysts/) [Cloudflare Radar](https://radar.cloudflare.com/) [Cloudflare TV](https://cloudflare.tv/)
Show the full extract — what AILANG Parse pulled from this page
# Launching the x402 Foundation with Coinbase, and support for x402 transactions


[Get Started Free](https://dash.cloudflare.com/sign-up)|[Contact Sales](https://www.cloudflare.com/plans/enterprise/contact/)|

▼

[The Cloudflare Blog](/)

Subscribe to receive notifications of new posts:

Subscribe

[AI](/tag/ai/)
[Developers](/tag/developers/)
[Radar](/tag/cloudflare-radar/)
[Product News](/tag/product-news/)
[Security](/tag/security/)
[Policy & Legal](/tag/policy/)
[Zero Trust](/tag/zero-trust/)
[Speed & Reliability](/tag/speed-and-reliability/)
[Life at Cloudflare](/tag/life-at-cloudflare/)
[Partners](/tag/partners/)

[AI](/tag/ai/)
[Developers](/tag/developers/)
[Radar](/tag/cloudflare-radar/)
[Product News](/tag/product-news/)
[Security](/tag/security/)
[Policy & Legal](/tag/policy/)
[Zero Trust](/tag/zero-trust/)
[Speed & Reliability](/tag/speed-and-reliability/)
[Life at Cloudflare](/tag/life-at-cloudflare/)
[Partners](/tag/partners/)

Launching the x402 Foundation with Coinbase, and support for x402 transactions
2025-09-23

[Will Allen](/author/will-allen/)

[Cam Whiteside](/author/cam-whiteside/)

[Rohin Lohe](/author/rohin/)

[Steve James](/author/steve-james/)

5 min read
This post is also available in [简体中文](/zh-cn/x402), [Français](/fr-fr/x402), [Deutsch](/de-de/x402), [Español](/es-es/x402), [Nederlands](/nl-nl/x402) and [繁體中文](/zh-tw/x402).

Cloudflare is partnering with Coinbase to create the x402 Foundation. This foundation’s mission will be to encourage the adoption of the [x402 protocol](https://github.com/coinbase/x402), an updated framework that allows clients and services to exchange value on the web using a common language. In addition to today’s partnership, we are shipping a set of features to allow developers to use x402 in the [Agents SDK](https://developers.cloudflare.com/agents/x402/) and our [MCP](https://developers.cloudflare.com/agents/model-context-protocol/) integrations, as well as proposing a new deferred payment scheme.

Payments in the age of agents
Payments on the web have historically been designed for humans. We browse a merchant’s website, show intent by adding items to a cart, and confirm our intent to purchase by inputting our credit card information and clicking “Pay.” But what if you want to enable direct transactions between digital services? We need protocols to allow machine-to-machine transactions. 
Every day, sites on Cloudflare send out over a billion HTTP 402 response codes to bots and crawlers trying to access their content and e-commerce stores. This response code comes with a simple message: “Payment Required.”
Yet these 402 responses too often go unheard. One reason is a lack of standardization. Without a specification for how to format and respond to those response codes, content creators, publishers, and website operators lack adequate tools to convey their payment requests. x402 can give developers a clear, open protocol for websites and automated agents to negotiate payments across the globe. 

A Primer on x402
Coinbase authored the x402 transaction flow, outlined below, to help machines pay directly for resources over HTTP:

A client attempts to access a resource gated by x402. 

The server responds with the status code 402 Payment Required. The response body contains payment instructions including the payment amount and recipient.

The client requests the x402-gated resource with the payment authorization header.

The payment facilitator verifies the client’s payment payload and settles the transaction.

The server responds with the requested resource in the response, along with the payment response header that confirms the payment outcome. 
This flow creates programmatic access to resources across the Internet. Clients and servers capable of interpreting the x402 protocol are able to transact without the need for accounts, subscriptions, or API keys.
x402 can be used to monetize traditional use cases, but also enables monetization of a new class of use cases. For example:

An assistant that is able to purchase accessories for your Halloween costume from multiple merchants.

An AI agent that pays per browser rendering session, instead of committing to a monthly subscription fee.

An autonomous stock trader that makes micropayments for a high quality real-time data feed to drive decisions.
Future versions of x402 could be agnostic of the payment rails, accommodating credit cards and bank accounts in addition to stablecoins. 

Cloudflare’s pay per crawl: proposing the x402 deferred payment scheme 
Agents and crawlers often require two important functions that already exist in much of today's financial infrastructure: delayed settlement to account for disputes; and a single, aggregated payment to make their accounting simpler. For example, crawlers participating in our [private beta of pay per crawl](https://blog.cloudflare.com/introducing-pay-per-crawl/) are able to crawl a vast number of pages easily, generate audit logs, and then be charged a single fee via a connected credit card or bank account at the end of each day. 
To account for these types of payment scenarios, we're proposing a new deferred payment scheme for the x402 protocol. This new scheme is specifically designed for agentic payments that don't need immediate settlement and can be handled either through traditional payment methods or stablecoins. By proposing this addition, we're helping to ensure that any compliant server can optionally decouple the cryptographic handshake from the payment settlement itself, giving agents and servers the ability to use pre-negotiated licensing agreements, batch settlements, or subscriptions.
We will be bringing this new deferred payment scheme to pay per crawl as we expand and evolve the private beta. 

The Handshake Explained
Here’s our initial proposal for the handshake that could be released in the next major version of x402:

1. The Server’s Offer
Today, an unauthenticated or unauthorized client attempts to access a resource and receives a `402 Payment Required` response. The server provides a payment commitment payload that the client can use to construct a re-request. This response is a machine-readable offer, and our proposal includes a new scheme of **deferred**.
`HTTP/1.1 402 Payment Required
Content-Type: application/json

{
  "accepts": [
    {
      "scheme": "deferred",
      "network": "example-network-provider",
      "resource": "https://example.com/page",
      "...": "...",
      "extras": {
        "id": "abc123",
        "termsUrl": "https://example.com/terms"
      },
    }
  ]
}`

2. The Client's Signed Commitment
Next, the client re-sends the request with a signed payload containing their payment commitment. The **deferred **scheme uses HTTP Message Signatures where a [JWK-formatted public key](https://datatracker.ietf.org/doc/html/rfc7517?cf_target_id=D4770F028006FD3F2FEE26B65F35A502) is available in a hosted directory. The `Signature-Input` header clearly explains which parts of the request are included in the `Signature` to serve as cryptographic proof of the client's intent, verifiable by the service provider without an on-chain transaction. 
`GET /path/to/resource HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0 Chrome/113.0.0 MyBotCrawler/1.1
Payment:
    scheme="deferred",
    network="example-network-provider",
    id="abc123"
Signature-Agent: signer.example.com
Signature-Input:
    sig=("payment" "signature-agent");
    created=1700000000;
    expires=1700011111;
    keyid="ba3e64==";
    tag="web-bot-auth"
Signature: sig=abc==`

3. Successful Response
The resource server validates the signature and returns the content with a confirmation header. The server is responsible for attributing the payment to the account associated with the **HTTP message signature**, verifying the client's identity and then delivering the content. In this scenario, there is no blockchain associated with the payments. 
`HTTP/1.1 200 OK
Content-Type: text/html
Payment-Response:
    scheme="deferred",
    network="example-network-provider",
    id="abc123",
    timestamp=1730872968`

4. Payment Settlement
The server can now handle the settlement flexibly. The validated id from the handshake acts as a reference for the transaction. This approach enables a flexible use model without per-request overhead, allowing the server to roll up payments on a subscription, daily, or even batch basis. This creates a flexible framework where the cryptographic trust is established immediately, while the financial settlement can use traditional payment rails or stablecoins. 

Cloudflare’s MCP servers, Agents SDK, and x402 payments
Running code is what moves an open convention from the theoretical to truly useful, and eventually to a recognized standard. Agents built using Cloudflare’s [Agent SDK](https://developers.cloudflare.com/agents/x402/) can now pay for resources with x402, and MCP servers can expose tools to be paid for via x402. To show how this works, we created the [x402 playground](https://playground.x402.cloudflare.com/), a live demo employing x402. The x402 playground is powered by the [Agents SDK](https://developers.cloudflare.com/agents/) and has access to tools from [MCP servers](https://developers.cloudflare.com/agents/guides/remote-mcp-server/) deployed on Cloudflare.
When you open the x402 playground, a new wallet is created and funded with Testnet USDC on a [Base blockchain testnet](https://docs.base.org/learn/deployment-to-testnet/test-networks). The agent, built with Agents SDK, has access to an MCP server with both free and paid tools.
`import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { McpAgent } from "agents/mcp";
import { withX402 } from "agents/x402";

export class PayMCP extends McpAgent {
  server = withX402(
    new McpServer({ name: "PayMCP", version: "1.0.0" }),
    X402_CONFIG
  );

  async init() {
    // Paid tool
    this.server.paidTool(
      "square",
      "Squares a number",
      0.01, // Tool price
      {
        a: z.number()
      },
      {},
      async ({ number }) => {
        return { content: [{ type: "text", text: String(a ** 2) }] };
      }
    );

    // Free tool
    this.server.tool(
      "add-two-numbers",
      "Adds two numbers",
      {
        a: z.number(),
        b: z.number(),
      },
      async ({ a, b }) => {
        return { content: [{ type: 'text', text: String(a + b) }] };
      }
    );
  }
}`
When the agent attempts to use a paid tool, the MCP server responds with a 402 Payment Required. The agent is able to interpret the payment instructions and prompt the human whether they want to proceed with the transaction. Building an x402-compatible client requires a basic wrapper on the tool call:
`import { Agent } from "agents";
import { withX402Client } from "agents/x402";

export class MyAgent extends Agent {
  // Your Agent definitions...

  async onToolCall() {

    // Build the x402 client
    const x402Client = withX402Client(
      myMcpClient,
      { network: "base-sepolia", account: this.account }
    );

    // The first parameter becomes the confirmation callback.
    // We can set it to `null` if we want the agent to pay automatically.
    const res = await x402Client.callTool(
      this.onPaymentRequired,
      {
        name: toolName,
        arguments: toolArgs
    });
  }
}`
This test agent draws down the funds from the wallet and sends the payment payload to the MCP server, which settles the transaction. The transactions can be specified to execute with or without human confirmation, allowing you to design the interface best suited for your application.

What’s next? 
You can get started today by using the [Agents SDK](https://developers.cloudflare.com/agents/x402/) or by deploying your own [MCP server](https://developers.cloudflare.com/agents/guides/remote-mcp-server/).
We’ll continue to work closely with Coinbase to establish the x402 Foundation. Stay tuned for more announcements on the specifics 
page preview · the URL we fetched https://blog.cloudflare.com/x402/ ↗
Screenshot of blog.cloudflare.com

Couldn't render a preview for this site. Open the URL in a new tab ↗

Screenshot via thum.io

blog.cloudflare.com scored 4/10 on agent-ready. AILANG opportunity is therefore 6/10. Here's where it would land first.

REST + MCP + A2A + OpenAPI in one command

ailang serve-api takes your typed AILANG functions and exposes them as REST endpoints, MCP tools, A2A skills, and OpenAPI 3.1 docs simultaneously. One module, four agent surfaces.

ailang serve-api --port 8092 --mcp-http \
  pricing.ail catalogue.ail
-- POST /api/pricing/quote, MCP at /mcp/,
-- A2A at /.well-known/agent.json, OpenAPI at /api/_meta/redoc.
→ AILANG docs

Contract-verified tool calls

Every tool an agent can call has a contract. Bounds, refusal paths, type signatures — proven before the agent ever sees it. The agent cannot exceed the tool's declared authority.

func placeOrder(item: SKU, qty: int) -> Receipt
  requires { qty > 0, qty <= 10 }
  ensures  { result.total > 0.0 }
-- the MCP server exposes this with its contract intact.
→ AILANG docs

An MCP server for your own docs and tools

Generate an MCP server from your typed AILANG functions; the docs MCP exposes a submit_feedback tool so agents can flag issues back to the maintainer. The language and its consumers stay on the same wire.

-- The AILANG docs MCP server lets Claude / Cursor / any
-- MCP client query the language directly:
--   stdlib_search "URL encoding"
--   submit_feedback "..."
→ AILANG docs

How this page was made

func sketchSite(url: string<pii>, topic: Topic) -> Sketch
  ! {Net @limit=1, AI @limit=5, FS @limit=4, Process, Declassify}
SignalTopicResultPointsAILANG primitive
agent.json referencedagent-ready0/1ailang serve-api generates A2A agent cards automatically — bonus if you're an early adopter
openapi.json referencedagent-ready0/2ailang serve-api generates OpenAPI 3.1 from Hindley-Milner type signatures
MCP endpoint referencedagent-ready2/2ailang serve-api --mcp-http exposes typed functions as MCP tools
Public API docs linkedagent-ready2/2ailang serve-api hosts Swagger + ReDoc at /api/_meta/ by default
Webhooks documentedagent-ready2/2ailang serve-api handles webhooks as typed handler functions with effect-tracked side effects
Rate limits documentedagent-ready0/2Capability budgets — Net @limit=N is the symmetric server-side primitive for what agents see as rate limits
Streaming / SSE endpointagent-ready0/2std/stream — ssePost and Stream effect handle event-source endpoints with typed event types
Sandbox / test environment offeredagent-ready2/2ailang --ai-stub plus mock effect handlers — deterministic, capability-scoped fakes for any effect, including Net and AI
Authentication documentedagent-ready2/2std/jwt for verification, IFC labels (string / string) to keep credentials out of public sinks at the type level
Idempotency keys documentedagent-ready0/2Pure functions are idempotent by construction; requires/ensures contracts express idempotence as a static guarantee
AG-UI streaming protocolagent-ready0/1std/stream — the AG-UI event lifecycle (RUN_STARTED → TEXT_MESSAGE_CONTENT → TOOL_CALL_RESULT → RUN_FINISHED) is a textbook sum type. ADTs + exhaustive pattern matching make every event-type branch a compile error to skip.
HTTP 402 agent payments (x402 / pay-per-crawl)agent-ready1/1Net @endpoint-scoped capability budgets bound payment destinations; requires { amount <= budget } gates the payload; IFC labels keep the signed payment key out of public sinks. Same primitives cover x402 payload signing and Cloudflare's crawler-price negotiation.
AP2 Agent Payments Protocolagent-ready0/1Mandates ARE contracts. requires { intent.price <= mandate.maxPrice } + ensures { cart.total <= intent.price } is a one-to-one translation of an Intent/Cart Mandate into AILANG. Z3 can verify the bounds at compile time.
UTCP tool-calling protocolagent-ready0/1Typed function signatures are the manifest. ailang serve-api emits the same metadata as a UTCPManual (name, input/output schema, native endpoint) — direct-call discovery without a proxy server.
End-to-end encryption documentedprivacy0/2IFC labels (string) force decryption to flow through a typed boundary; the compiler refuses to publish sealed values without explicit declassification
Compliance certifications citedprivacy2/2requires/ensures contracts express machine-verifiable claims; capability budgets bound audit-trail effects; effect rows leave nothing un-declared
Data minimisation languageprivacy2/2Capability scoping — each Net call declares its endpoint in the effect row, so "doesn't sell" becomes a type-system-enforceable claim, not a marketing one
Third-party domains restrainedprivacy0/2Capability scoping — each Net call declares its endpoint in the effect row
Data residency / on-prem languageprivacy0/2Three-runtime deploy — same module runs in WASM (browser), Cloud Run, and native CLI
Single-vendor LLM languageportable2/2std/ai multi-provider — switch from Anthropic to Gemini to OpenAI without rewriting
Multiple AI providers citedportable2/2std/ai — one Step API across Anthropic, OpenAI, Gemini, OpenRouter, Ollama, and custom-package providers
Cross-runtime / deployment portabilityportable0/2Effect handlers as runtime adapters — same .ail runs as WASM in the browser, a Cloud Run container, and a native CLI; only the handlers change
BYO key / model-agnosticportable0/2AILANG WASM — the full interpreter ships as a browser bundle, so caller-held keys (BYOK), offline apps, and embedded demos all work client-side