Skip to content

X402

POST/admin/x402/cache/clear
POST
/admin/x402/cache/clear

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Response Body

curl -X POST "https://example.com/admin/x402/cache/clear"
Empty
GET/admin/x402/preflight
GET
/admin/x402/preflight

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Response Body

application/json

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
GET
/admin/x402/pricing

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

filter?

Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.

sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: service, created_at. Default: -created_at.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
total?boolean

Set to true to include the number of matching rows in page.total.

Response Body

application/json

curl -X GET "https://example.com/admin/x402/pricing"
{  "page": {    "has_more": true,    "next_cursor": "string",    "page": 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
GET
/admin/x402/pricing/default

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Response Body

application/json

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
DELETE
/admin/x402/pricing/default

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X DELETE "https://example.com/admin/x402/pricing/default"
{  "deleted": true}
PUT/admin/x402/pricing/default
PUT
/admin/x402/pricing/default

Authorization

bearer_token
AuthorizationBearer <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
POST
/admin/x402/pricing/endpoints

Authorization

bearer_token
AuthorizationBearer <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}
GET
/admin/x402/pricing/endpoints/{method}/{endpoint_path}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

method*string

HTTP method

endpoint_path*string

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}
DELETE
/admin/x402/pricing/endpoints/{method}/{endpoint_path}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

method*string

HTTP method

endpoint_path*string

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
POST
/admin/x402/pricing/services

Authorization

bearer_token
AuthorizationBearer <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}
GET
/admin/x402/pricing/services/{service}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

service*string

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}
DELETE
/admin/x402/pricing/services/{service}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

service*string

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}
PUT
/admin/x402/pricing/services/{service}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

service*string

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
GET
/api/v1/x402/balance

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://example.com/api/v1/x402/balance"
{  "balance_atomic": 0,  "balance_usd": "string"}
GET/api/v1/x402/quote
GET
/api/v1/x402/quote

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

method*string

HTTP method (case-insensitive)

path*string

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
GET
/api/v1/x402/status

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Response Body

application/json

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
POST
/api/v1/x402/topup

Authorization

bearer_token
AuthorizationBearer <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
GET
/x402/catalog

Response Body

application/json

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
curl -X POST "https://example.com/x402/session"
{  "expires_in": 0,  "principal": "string",  "token": "string",  "token_type": "string"}