Build once, register reliably, and keep your MPP resources discoverable.
If agents can't discover your API, they can't call it. Bulletproof discovery turns your endpoint from merely listed to reliably invocable.
When metadata and runtime 402 behavior agree, agents succeed on the first pass. You get fewer MPPScan failures, less debugging churn, and more real agent traffic.
402 challenge behavior as the final source of truth.Paste this directly into your coding agent. It should handle discovery implementation and validation end-to-end.
OpenAPI is the canonical discovery format. Use it for the cleanest machine-readable contract and best agent compatibility.
Use this first. It gives the cleanest machine-readable contract and best tooling compatibility.
Expected location: GET /openapi.json
{
"openapi": "3.1.0",
"info": {
"title": "My API",
"version": "1.0.0",
"description": "example demo server",
"guidance": "Use POST /api/search for neural web search. Accepts a JSON body with a 'query' field."
},
"x-discovery": {
"ownershipProofs": ["<proof-1>"]
},
"paths": {
"/api/search": {
"post": {
"operationId": "search",
"summary": "Search - Neural search across the web",
"tags": ["Search"],
"x-payment-info": {
"pricingMode": "fixed",
"price": "0.010000",
"protocols": ["x402", "mpp"]
},
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"query": { "type": "string", "minLength": 1, "description": "The query string for the search" }
},
"required": ["query"]
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"results": { "type": "array", "items": { "type": "object" } }
},
"required": ["results"]
}
}
}
},
"402": { "description": "Payment Required" }
}
}
}
}
}MPPScan uses the OpenAPI document at /openapi.json to discover your API. It will also check the runtime 402 challenge behavior to ensure it is correct.
| Order | Source | Expected Location |
|---|---|---|
| 1 | OpenAPI document | /openapi.json |
| 2 | 402 API Response | WWW-Authenticate header |
These are the most frequent errors seen during registration.
| Error | Likely Cause | Fix |
|---|---|---|
Not Found | OpenAPI not found at {origin}/openapi.json | Add a OpenAPI document at {origin}/openapi.json |
Input/Output Schema Missing | Operation has no input or output schema | Add an input and output schema to the operation |
WWW-Authenticate Header Missing | Invalid WWW-Authenticate header | Add a valid MPP-based WWW-Authenticate header |
Payment/Auth Mode Missing | x-payment-info.protocols is missing | Add x-payment-info.protocols.pricingMode |