agentgrade

EnglishEspañol日本語中文
← Knowledge Base

What is x-payment-info?

x-payment-info is an OpenAPI extension that tells agents which endpoints cost money and how much — before they make a request. Instead of triggering a 402 to learn the price, agents can read the OpenAPI spec upfront.

How it works

Add the extension to any paid operation in your /openapi.json:

{
  "paths": {
    "/api/v1/submit": {
      "post": {
        "x-payment-info": {
          "authMode": "payment-required",
          "protocols": [
            { "mpp": { "method": "tempo", "intent": "charge" } },
            { "mpp": { "method": "stripe", "intent": "charge" } },
            { "x402": {} }
          ],
          "price": {
            "mode": "fixed",
            "amount": "0.50",
            "currency": "USD"
          }
        }
      }
    }
  }
}

Key concepts

Why it matters

Without x-payment-info, agents must hit every endpoint to discover if it's paid and how much it costs. With it, agents can read the spec once and plan their budget across multiple API calls.

How agentgrade checks for it

agentgrade reads your /openapi.json and checks if any operation has an x-payment-info extension. This is an optional check in the OpenAPI scoring group — it can help your score but won't hurt it if missing.

Learn more