X402
POST/admin/x402/cache/clear
curl -X POST "https://example.com/admin/x402/cache/clear"GET/admin/x402/preflight
curl -X GET "https://example.com/admin/x402/preflight"{ "checks": [ { "check": "string", "detail": "string", "passed": true, "severity": "required" } ], "enabled": true, "facilitator_url": "string", "mainnet": true, "networks": [ "string" ], "ready": true}GET/admin/x402/pricing
Authorization
bearer_token In: header
Query Parameters
Filter by rule type (default, service, endpoint)
Filter by service name
Page number (1-based)
int640 <= valuePage size
int640 <= valueSort field
Sort order (asc or desc)
Value in
- "asc"
- "desc"
Response Body
application/json
curl -X GET "https://example.com/admin/x402/pricing"{ "pagination": { "has_more": true, "page": 0, "page_size": 0, "total": 0 }, "rules": [ { "amount_usd": "string", "created_at": "2019-08-24T14:15:22Z", "description": "string", "discoverable": true, "enabled": true, "id": "string", "method": "string", "path": "string", "rule_type": "default", "service": "string", "settle_mode": null, "updated_at": "2019-08-24T14:15:22Z" } ]}GET/admin/x402/pricing/default
curl -X GET "https://example.com/admin/x402/pricing/default"{ "amount_usd": "string", "created_at": "2019-08-24T14:15:22Z", "description": "string", "discoverable": true, "enabled": true, "id": "string", "method": "string", "path": "string", "rule_type": "default", "service": "string", "settle_mode": null, "updated_at": "2019-08-24T14:15:22Z"}DELETE/admin/x402/pricing/default
curl -X DELETE "https://example.com/admin/x402/pricing/default"{ "deleted": true}PUT/admin/x402/pricing/default
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Fields shared by every price rule write.
Response Body
application/json
curl -X PUT "https://example.com/admin/x402/pricing/default" \ -H "Content-Type: application/json" \ -d '{ "amount_usd": "string" }'{ "amount_usd": "string", "created_at": "2019-08-24T14:15:22Z", "description": "string", "discoverable": true, "enabled": true, "id": "string", "method": "string", "path": "string", "rule_type": "default", "service": "string", "settle_mode": null, "updated_at": "2019-08-24T14:15:22Z"}POST/admin/x402/pricing/endpoints
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Create or replace an endpoint-level price rule. The owning service is derived from the path's first segment.
Response Body
application/json
curl -X POST "https://example.com/admin/x402/pricing/endpoints" \ -H "Content-Type: application/json" \ -d '{ "amount_usd": "string", "method": "string", "path": "string" }'{ "amount_usd": "string", "created_at": "2019-08-24T14:15:22Z", "description": "string", "discoverable": true, "enabled": true, "id": "string", "method": "string", "path": "string", "rule_type": "default", "service": "string", "settle_mode": null, "updated_at": "2019-08-24T14:15:22Z"}GET/admin/x402/pricing/endpoints/{method}/{endpoint_path}
Authorization
bearer_token In: header
Path Parameters
HTTP method
Router path template
Response Body
application/json
curl -X GET "https://example.com/admin/x402/pricing/endpoints/string/string"{ "amount_usd": "string", "created_at": "2019-08-24T14:15:22Z", "description": "string", "discoverable": true, "enabled": true, "id": "string", "method": "string", "path": "string", "rule_type": "default", "service": "string", "settle_mode": null, "updated_at": "2019-08-24T14:15:22Z"}DELETE/admin/x402/pricing/endpoints/{method}/{endpoint_path}
Authorization
bearer_token In: header
Path Parameters
HTTP method
Router path template
Response Body
application/json
curl -X DELETE "https://example.com/admin/x402/pricing/endpoints/string/string"{ "deleted": true}POST/admin/x402/pricing/services
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Create or replace a service-level price rule.
Response Body
application/json
curl -X POST "https://example.com/admin/x402/pricing/services" \ -H "Content-Type: application/json" \ -d '{ "amount_usd": "string", "service": "string" }'{ "amount_usd": "string", "created_at": "2019-08-24T14:15:22Z", "description": "string", "discoverable": true, "enabled": true, "id": "string", "method": "string", "path": "string", "rule_type": "default", "service": "string", "settle_mode": null, "updated_at": "2019-08-24T14:15:22Z"}GET/admin/x402/pricing/services/{service}
Authorization
bearer_token In: header
Path Parameters
Service name
Response Body
application/json
curl -X GET "https://example.com/admin/x402/pricing/services/string"{ "amount_usd": "string", "created_at": "2019-08-24T14:15:22Z", "description": "string", "discoverable": true, "enabled": true, "id": "string", "method": "string", "path": "string", "rule_type": "default", "service": "string", "settle_mode": null, "updated_at": "2019-08-24T14:15:22Z"}DELETE/admin/x402/pricing/services/{service}
Authorization
bearer_token In: header
Path Parameters
Service name
Response Body
application/json
curl -X DELETE "https://example.com/admin/x402/pricing/services/string"{ "deleted": true}PUT/admin/x402/pricing/services/{service}
Authorization
bearer_token In: header
Path Parameters
Service name
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Fields shared by every price rule write.
Response Body
application/json
curl -X PUT "https://example.com/admin/x402/pricing/services/string" \ -H "Content-Type: application/json" \ -d '{ "amount_usd": "string" }'{ "amount_usd": "string", "created_at": "2019-08-24T14:15:22Z", "description": "string", "discoverable": true, "enabled": true, "id": "string", "method": "string", "path": "string", "rule_type": "default", "service": "string", "settle_mode": null, "updated_at": "2019-08-24T14:15:22Z"}GET/api/v1/x402/balance
curl -X GET "https://example.com/api/v1/x402/balance"{ "balance_atomic": 0, "balance_usd": "string"}GET/api/v1/x402/quote
Authorization
bearer_token In: header
Query Parameters
HTTP method (case-insensitive)
Router path template or concrete path (e.g. "/kv/{key}")
Response Body
application/json
curl -X GET "https://example.com/api/v1/x402/quote?method=string&path=string"{ "amount_usd": "string", "payable": true, "rule_id": "string", "settle_mode": null}GET/api/v1/x402/status
curl -X GET "https://example.com/api/v1/x402/status"{ "enabled": true, "networks": [ "string" ], "settle_mode_default": "verify_then_settle_after"}POST/api/v1/x402/topup
Authorization
bearer_token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Request to top up the prepaid x402 balance.
Response Body
application/json
curl -X POST "https://example.com/api/v1/x402/topup" \ -H "Content-Type: application/json" \ -d '{ "amount_usd": "string" }'{ "balance_atomic": 0, "balance_usd": "string", "credited_usd": "string", "transaction": "string"}GET/x402/catalog
curl -X GET "https://example.com/x402/catalog"{ "enabled": true, "items": [ { "accepts": [ null ], "accepts_v2": [ null ], "amount_usd": "string", "description": "string", "method": "string", "path": "string", "resource": "string", "service": "string" } ]}POST/x402/session
Response Body
application/json
curl -X POST "https://example.com/x402/session"{ "expires_in": 0, "principal": "string", "token": "string", "token_type": "string"}