{
  "openapi": "3.1.0",
  "info": {
    "title": "SableForge x402 API",
    "version": "2.0.0",
    "description": "Twelve pay-per-call endpoints for autonomous agents. Every endpoint answers with HTTP 402 and an x402 v2 payment challenge until a valid EIP-3009 authorization is supplied in the `PAYMENT-SIGNATURE` header. Settlement is USDC on Base (eip155:8453) via the PayAI facilitator.\n\n**No API keys, no accounts, no signup \u2014 the payment is the authentication.**",
    "contact": {
      "email": "sableforge-apis@uberip.com",
      "url": "http://sableforge.servehttp.com/"
    },
    "license": {
      "name": "Commercial pay-per-call"
    },
    "x-guidance": "This API is paid per call. To invoke any operation: (1) send the request with no payment header and expect HTTP 402 \u2014 the base64 `PAYMENT-REQUIRED` response header is the x402 v2 challenge; (2) read `accepts[0]` (scheme `exact`, network `eip155:8453`, asset USDC, amount in 6-decimal atomic units, payTo, maxTimeoutSeconds, extra.name/version); (3) sign an EIP-712 EIP-3009 `TransferWithAuthorization` for that amount to `payTo` with a random 32-byte nonce and `validBefore = now + maxTimeoutSeconds`, using domain name `USD Coin`, version `2`, chainId 8453, verifyingContract = the USDC address; (4) base64-encode `{\"x402Version\":2,\"accepted\":<accepts[0]>,\"payload\":{\"signature\":\"0x...\",\"authorization\":{...}}}` and resend the identical request with it in the `PAYMENT-SIGNATURE` header. A 200 carries the JSON body plus a settlement receipt in `PAYMENT-RESPONSE`. Prices range from $0.0005 to $0.0020 per call; every price is visible in the 402 before you commit, so budgets are deterministic. Prefer `/api/llm` for text generation (local 27B model), `/api/price` for spot crypto prices, and the `/api/block`, `/api/tx`, `/api/addr` trio for Base on-chain reads."
  },
  "servers": [
    {
      "url": "http://sableforge.servehttp.com",
      "description": "Production (Base mainnet, USDC)"
    }
  ],
  "tags": [
    {
      "name": "market"
    },
    {
      "name": "data"
    },
    {
      "name": "security"
    },
    {
      "name": "utility"
    },
    {
      "name": "finance"
    },
    {
      "name": "chain"
    },
    {
      "name": "web"
    },
    {
      "name": "ai"
    }
  ],
  "paths": {
    "/api/price": {
      "get": {
        "summary": "Live crypto spot prices",
        "description": "Live crypto prices (CoinGecko). ?ids=bitcoin,ethereum&vs_currencies=usd\n\n**Price:** $0.0010 USDC on Base per call. Payment is required via x402 v2: an unauthenticated request returns HTTP 402 with a base64 `PAYMENT-REQUIRED` header; retry with a signed `PAYMENT-SIGNATURE` header.",
        "operationId": "sableforge_price",
        "tags": [
          "market"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "amount": "0.001",
            "currency": "USD"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid response (settled on-chain).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "bitcoin": {
                    "usd": 83000
                  },
                  "ethereum": {
                    "usd": 2600
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "example": {
                  "x402": {
                    "x402Version": 2,
                    "resource": {
                      "url": "http://sableforge.servehttp.com/api/price",
                      "description": "Live crypto prices (CoinGecko). ?ids=bitcoin,ethereum&vs_currencies=usd",
                      "mimeType": "application/json",
                      "serviceName": "base-data-api",
                      "tags": [
                        "crypto",
                        "price",
                        "market"
                      ]
                    },
                    "accepts": [
                      {
                        "scheme": "exact",
                        "network": "eip155:8453",
                        "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                        "amount": "1000",
                        "payTo": "0xa6219b4745cfe59488405bc66083660724af948b",
                        "maxTimeoutSeconds": 600,
                        "extra": {
                          "name": "USD Coin",
                          "version": "2",
                          "assetTransferMethod": "eip3009"
                        }
                      }
                    ],
                    "extensions": {
                      "bazaar": {
                        "info": {
                          "input": {
                            "type": "http",
                            "method": "GET",
                            "queryParams": {
                              "ids": "bitcoin,ethereum",
                              "vs_currencies": "usd"
                            }
                          },
                          "output": {
                            "type": "json",
                            "example": {
                              "bitcoin": {
                                "usd": 83000
                              },
                              "ethereum": {
                                "usd": 2600
                              }
                            }
                          }
                        },
                        "schema": {
                          "$schema": "https://json-schema.org/draft/2020-12/schema",
                          "type": "object",
                          "properties": {
                            "input": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "http"
                                },
                                "method": {
                                  "type": "string",
                                  "enum": [
                                    "GET",
                                    "HEAD",
                                    "DELETE"
                                  ]
                                },
                                "queryParams": {
                                  "type": "object",
                                  "properties": {
                                    "ids": {
                                      "type": "string"
                                    },
                                    "vs_currencies": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "required": [
                                "type",
                                "method"
                              ],
                              "additionalProperties": false
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "example": {
                                  "type": "object"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          },
                          "required": [
                            "input"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Settlement failed at the facilitator (not charged)."
          }
        },
        "parameters": [
          {
            "name": "ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "bitcoin,ethereum",
            "description": "Example: bitcoin,ethereum"
          },
          {
            "name": "vs_currencies",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "usd",
            "description": "Example: usd"
          }
        ]
      }
    },
    "/api/geo": {
      "get": {
        "summary": "IP geolocation",
        "description": "IP geolocation (country, city, ISP, lat/lon). ?ip=8.8.8.8\n\n**Price:** $0.0010 USDC on Base per call. Payment is required via x402 v2: an unauthenticated request returns HTTP 402 with a base64 `PAYMENT-REQUIRED` header; retry with a signed `PAYMENT-SIGNATURE` header.",
        "operationId": "sableforge_geo",
        "tags": [
          "data"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "amount": "0.001",
            "currency": "USD"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid response (settled on-chain).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "status": "success",
                  "country": "United States",
                  "city": "Mountain View"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "example": {
                  "x402": {
                    "x402Version": 2,
                    "resource": {
                      "url": "http://sableforge.servehttp.com/api/geo",
                      "description": "IP geolocation (country, city, ISP, lat/lon). ?ip=8.8.8.8",
                      "mimeType": "application/json",
                      "serviceName": "base-data-api",
                      "tags": [
                        "ip",
                        "geo",
                        "lookup"
                      ]
                    },
                    "accepts": [
                      {
                        "scheme": "exact",
                        "network": "eip155:8453",
                        "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                        "amount": "1000",
                        "payTo": "0xa6219b4745cfe59488405bc66083660724af948b",
                        "maxTimeoutSeconds": 600,
                        "extra": {
                          "name": "USD Coin",
                          "version": "2",
                          "assetTransferMethod": "eip3009"
                        }
                      }
                    ],
                    "extensions": {
                      "bazaar": {
                        "info": {
                          "input": {
                            "type": "http",
                            "method": "GET",
                            "queryParams": {
                              "ip": "8.8.8.8"
                            }
                          },
                          "output": {
                            "type": "json",
                            "example": {
                              "status": "success",
                              "country": "United States",
                              "city": "Mountain View"
                            }
                          }
                        },
                        "schema": {
                          "$schema": "https://json-schema.org/draft/2020-12/schema",
                          "type": "object",
                          "properties": {
                            "input": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "http"
                                },
                                "method": {
                                  "type": "string",
                                  "enum": [
                                    "GET",
                                    "HEAD",
                                    "DELETE"
                                  ]
                                },
                                "queryParams": {
                                  "type": "object",
                                  "properties": {
                                    "ip": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "required": [
                                "type",
                                "method"
                              ],
                              "additionalProperties": false
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "example": {
                                  "type": "object"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          },
                          "required": [
                            "input"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Settlement failed at the facilitator (not charged)."
          }
        },
        "parameters": [
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "8.8.8.8",
            "description": "Example: 8.8.8.8"
          }
        ]
      }
    },
    "/api/dns": {
      "get": {
        "summary": "DNS record lookup",
        "description": "DNS record lookup (A/AAAA/MX/TXT/CNAME/SOA/NS/PTR). ?host=example.com&type=A\n\n**Price:** $0.0010 USDC on Base per call. Payment is required via x402 v2: an unauthenticated request returns HTTP 402 with a base64 `PAYMENT-REQUIRED` header; retry with a signed `PAYMENT-SIGNATURE` header.",
        "operationId": "sableforge_dns",
        "tags": [
          "security"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "amount": "0.001",
            "currency": "USD"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid response (settled on-chain).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "host": "example.com",
                  "type": "A",
                  "status": 0,
                  "answers": [
                    "93.184.215.14"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "example": {
                  "x402": {
                    "x402Version": 2,
                    "resource": {
                      "url": "http://sableforge.servehttp.com/api/dns",
                      "description": "DNS record lookup (A/AAAA/MX/TXT/CNAME/SOA/NS/PTR). ?host=example.com&type=A",
                      "mimeType": "application/json",
                      "serviceName": "base-data-api",
                      "tags": [
                        "dns",
                        "lookup",
                        "security"
                      ]
                    },
                    "accepts": [
                      {
                        "scheme": "exact",
                        "network": "eip155:8453",
                        "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                        "amount": "1000",
                        "payTo": "0xa6219b4745cfe59488405bc66083660724af948b",
                        "maxTimeoutSeconds": 600,
                        "extra": {
                          "name": "USD Coin",
                          "version": "2",
                          "assetTransferMethod": "eip3009"
                        }
                      }
                    ],
                    "extensions": {
                      "bazaar": {
                        "info": {
                          "input": {
                            "type": "http",
                            "method": "GET",
                            "queryParams": {
                              "host": "example.com",
                              "type": "A"
                            }
                          },
                          "output": {
                            "type": "json",
                            "example": {
                              "host": "example.com",
                              "type": "A",
                              "status": 0,
                              "answers": [
                                "93.184.215.14"
                              ]
                            }
                          }
                        },
                        "schema": {
                          "$schema": "https://json-schema.org/draft/2020-12/schema",
                          "type": "object",
                          "properties": {
                            "input": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "http"
                                },
                                "method": {
                                  "type": "string",
                                  "enum": [
                                    "GET",
                                    "HEAD",
                                    "DELETE"
                                  ]
                                },
                                "queryParams": {
                                  "type": "object",
                                  "properties": {
                                    "host": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "required": [
                                "type",
                                "method"
                              ],
                              "additionalProperties": false
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "example": {
                                  "type": "object"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          },
                          "required": [
                            "input"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Settlement failed at the facilitator (not charged)."
          }
        },
        "parameters": [
          {
            "name": "host",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "example.com",
            "description": "Example: example.com"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "A",
            "description": "Example: A"
          }
        ]
      }
    },
    "/api/hash": {
      "get": {
        "summary": "Cryptographic hashing",
        "description": "Cryptographic hash of a text string (sha256/sha512/sha1/md5), hex + base64. ?text=hi&alg=sha256\n\n**Price:** $0.0010 USDC on Base per call. Payment is required via x402 v2: an unauthenticated request returns HTTP 402 with a base64 `PAYMENT-REQUIRED` header; retry with a signed `PAYMENT-SIGNATURE` header.",
        "operationId": "sableforge_hash",
        "tags": [
          "utility"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "amount": "0.001",
            "currency": "USD"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid response (settled on-chain).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "alg": "sha256",
                  "hex": "2cf24dba...",
                  "base64": "LPDbh++..."
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "example": {
                  "x402": {
                    "x402Version": 2,
                    "resource": {
                      "url": "http://sableforge.servehttp.com/api/hash",
                      "description": "Cryptographic hash of a text string (sha256/sha512/sha1/md5), hex + base64. ?text=hi&alg=sha256",
                      "mimeType": "application/json",
                      "serviceName": "base-data-api",
                      "tags": [
                        "hash",
                        "crypto",
                        "utility"
                      ]
                    },
                    "accepts": [
                      {
                        "scheme": "exact",
                        "network": "eip155:8453",
                        "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                        "amount": "1000",
                        "payTo": "0xa6219b4745cfe59488405bc66083660724af948b",
                        "maxTimeoutSeconds": 600,
                        "extra": {
                          "name": "USD Coin",
                          "version": "2",
                          "assetTransferMethod": "eip3009"
                        }
                      }
                    ],
                    "extensions": {
                      "bazaar": {
                        "info": {
                          "input": {
                            "type": "http",
                            "method": "GET",
                            "queryParams": {
                              "text": "hello",
                              "alg": "sha256"
                            }
                          },
                          "output": {
                            "type": "json",
                            "example": {
                              "alg": "sha256",
                              "hex": "2cf24dba...",
                              "base64": "LPDbh++..."
                            }
                          }
                        },
                        "schema": {
                          "$schema": "https://json-schema.org/draft/2020-12/schema",
                          "type": "object",
                          "properties": {
                            "input": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "http"
                                },
                                "method": {
                                  "type": "string",
                                  "enum": [
                                    "GET",
                                    "HEAD",
                                    "DELETE"
                                  ]
                                },
                                "queryParams": {
                                  "type": "object",
                                  "properties": {
                                    "text": {
                                      "type": "string"
                                    },
                                    "alg": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "required": [
                                "type",
                                "method"
                              ],
                              "additionalProperties": false
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "example": {
                                  "type": "object"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          },
                          "required": [
                            "input"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Settlement failed at the facilitator (not charged)."
          }
        },
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "hello",
            "description": "Example: hello"
          },
          {
            "name": "alg",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "sha256",
            "description": "Example: sha256"
          }
        ]
      }
    },
    "/api/time": {
      "get": {
        "summary": "Base time & block height",
        "description": "Current UTC time + latest Base mainnet block number. ?format=iso|unix\n\n**Price:** $0.0005 USDC on Base per call. Payment is required via x402 v2: an unauthenticated request returns HTTP 402 with a base64 `PAYMENT-REQUIRED` header; retry with a signed `PAYMENT-SIGNATURE` header.",
        "operationId": "sableforge_time",
        "tags": [
          "utility"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "amount": "0.0005",
            "currency": "USD"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid response (settled on-chain).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "iso": "2026-09-30T00:00:00Z",
                  "unix": 1790000000,
                  "base_block": 12345678
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "example": {
                  "x402": {
                    "x402Version": 2,
                    "resource": {
                      "url": "http://sableforge.servehttp.com/api/time",
                      "description": "Current UTC time + latest Base mainnet block number. ?format=iso|unix",
                      "mimeType": "application/json",
                      "serviceName": "base-data-api",
                      "tags": [
                        "time",
                        "block",
                        "base"
                      ]
                    },
                    "accepts": [
                      {
                        "scheme": "exact",
                        "network": "eip155:8453",
                        "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                        "amount": "500",
                        "payTo": "0xa6219b4745cfe59488405bc66083660724af948b",
                        "maxTimeoutSeconds": 600,
                        "extra": {
                          "name": "USD Coin",
                          "version": "2",
                          "assetTransferMethod": "eip3009"
                        }
                      }
                    ],
                    "extensions": {
                      "bazaar": {
                        "info": {
                          "input": {
                            "type": "http",
                            "method": "GET",
                            "queryParams": {
                              "format": "iso"
                            }
                          },
                          "output": {
                            "type": "json",
                            "example": {
                              "iso": "2026-09-30T00:00:00Z",
                              "unix": 1790000000,
                              "base_block": 12345678
                            }
                          }
                        },
                        "schema": {
                          "$schema": "https://json-schema.org/draft/2020-12/schema",
                          "type": "object",
                          "properties": {
                            "input": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "http"
                                },
                                "method": {
                                  "type": "string",
                                  "enum": [
                                    "GET",
                                    "HEAD",
                                    "DELETE"
                                  ]
                                },
                                "queryParams": {
                                  "type": "object",
                                  "properties": {
                                    "format": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "required": [
                                "type",
                                "method"
                              ],
                              "additionalProperties": false
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "example": {
                                  "type": "object"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          },
                          "required": [
                            "input"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Settlement failed at the facilitator (not charged)."
          }
        },
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "iso|unix",
            "description": "Example: iso|unix"
          }
        ]
      }
    },
    "/api/text": {
      "get": {
        "summary": "Text statistics",
        "description": "Text statistics: chars, words, lines, bytes. ?text=...\n\n**Price:** $0.0005 USDC on Base per call. Payment is required via x402 v2: an unauthenticated request returns HTTP 402 with a base64 `PAYMENT-REQUIRED` header; retry with a signed `PAYMENT-SIGNATURE` header.",
        "operationId": "sableforge_text",
        "tags": [
          "utility"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "amount": "0.0005",
            "currency": "USD"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid response (settled on-chain).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "chars": 11,
                  "words": 2,
                  "lines": 1,
                  "bytes": 11
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "example": {
                  "x402": {
                    "x402Version": 2,
                    "resource": {
                      "url": "http://sableforge.servehttp.com/api/text",
                      "description": "Text statistics: chars, words, lines, bytes. ?text=...",
                      "mimeType": "application/json",
                      "serviceName": "base-data-api",
                      "tags": [
                        "text",
                        "utility"
                      ]
                    },
                    "accepts": [
                      {
                        "scheme": "exact",
                        "network": "eip155:8453",
                        "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                        "amount": "500",
                        "payTo": "0xa6219b4745cfe59488405bc66083660724af948b",
                        "maxTimeoutSeconds": 600,
                        "extra": {
                          "name": "USD Coin",
                          "version": "2",
                          "assetTransferMethod": "eip3009"
                        }
                      }
                    ],
                    "extensions": {
                      "bazaar": {
                        "info": {
                          "input": {
                            "type": "http",
                            "method": "GET",
                            "queryParams": {
                              "text": "hello world"
                            }
                          },
                          "output": {
                            "type": "json",
                            "example": {
                              "chars": 11,
                              "words": 2,
                              "lines": 1,
                              "bytes": 11
                            }
                          }
                        },
                        "schema": {
                          "$schema": "https://json-schema.org/draft/2020-12/schema",
                          "type": "object",
                          "properties": {
                            "input": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "http"
                                },
                                "method": {
                                  "type": "string",
                                  "enum": [
                                    "GET",
                                    "HEAD",
                                    "DELETE"
                                  ]
                                },
                                "queryParams": {
                                  "type": "object",
                                  "properties": {
                                    "text": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "required": [
                                "type",
                                "method"
                              ],
                              "additionalProperties": false
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "example": {
                                  "type": "object"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          },
                          "required": [
                            "input"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Settlement failed at the facilitator (not charged)."
          }
        },
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "hello%20world",
            "description": "Example: hello%20world"
          }
        ]
      }
    },
    "/api/fx": {
      "get": {
        "summary": "FX & asset rates",
        "description": "FX / asset exchange rates from a base currency. ?base=USD\n\n**Price:** $0.0010 USDC on Base per call. Payment is required via x402 v2: an unauthenticated request returns HTTP 402 with a base64 `PAYMENT-REQUIRED` header; retry with a signed `PAYMENT-SIGNATURE` header.",
        "operationId": "sableforge_fx",
        "tags": [
          "finance"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "amount": "0.001",
            "currency": "USD"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid response (settled on-chain).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "base": "USD",
                  "eur": 0.9,
                  "btc": 1.2e-05
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "example": {
                  "x402": {
                    "x402Version": 2,
                    "resource": {
                      "url": "http://sableforge.servehttp.com/api/fx",
                      "description": "FX / asset exchange rates from a base currency. ?base=USD",
                      "mimeType": "application/json",
                      "serviceName": "base-data-api",
                      "tags": [
                        "fx",
                        "exchange",
                        "rates"
                      ]
                    },
                    "accepts": [
                      {
                        "scheme": "exact",
                        "network": "eip155:8453",
                        "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                        "amount": "1000",
                        "payTo": "0xa6219b4745cfe59488405bc66083660724af948b",
                        "maxTimeoutSeconds": 600,
                        "extra": {
                          "name": "USD Coin",
                          "version": "2",
                          "assetTransferMethod": "eip3009"
                        }
                      }
                    ],
                    "extensions": {
                      "bazaar": {
                        "info": {
                          "input": {
                            "type": "http",
                            "method": "GET",
                            "queryParams": {
                              "base": "USD"
                            }
                          },
                          "output": {
                            "type": "json",
                            "example": {
                              "base": "USD",
                              "eur": 0.9,
                              "btc": 1.2e-05
                            }
                          }
                        },
                        "schema": {
                          "$schema": "https://json-schema.org/draft/2020-12/schema",
                          "type": "object",
                          "properties": {
                            "input": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "http"
                                },
                                "method": {
                                  "type": "string",
                                  "enum": [
                                    "GET",
                                    "HEAD",
                                    "DELETE"
                                  ]
                                },
                                "queryParams": {
                                  "type": "object",
                                  "properties": {
                                    "base": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "required": [
                                "type",
                                "method"
                              ],
                              "additionalProperties": false
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "example": {
                                  "type": "object"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          },
                          "required": [
                            "input"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Settlement failed at the facilitator (not charged)."
          }
        },
        "parameters": [
          {
            "name": "base",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "USD",
            "description": "Example: USD"
          }
        ]
      }
    },
    "/api/block": {
      "get": {
        "summary": "Base block explorer",
        "description": "Base mainnet block info by number (hash, timestamp, gas, tx count). ?number=12345678\n\n**Price:** $0.0010 USDC on Base per call. Payment is required via x402 v2: an unauthenticated request returns HTTP 402 with a base64 `PAYMENT-REQUIRED` header; retry with a signed `PAYMENT-SIGNATURE` header.",
        "operationId": "sableforge_block",
        "tags": [
          "chain"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "amount": "0.001",
            "currency": "USD"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid response (settled on-chain).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "number": 12345678,
                  "hash": "0x..",
                  "timestamp": 1790000000,
                  "tx_count": 120
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "example": {
                  "x402": {
                    "x402Version": 2,
                    "resource": {
                      "url": "http://sableforge.servehttp.com/api/block",
                      "description": "Base mainnet block info by number (hash, timestamp, gas, tx count). ?number=12345678",
                      "mimeType": "application/json",
                      "serviceName": "base-data-api",
                      "tags": [
                        "base",
                        "block",
                        "chain"
                      ]
                    },
                    "accepts": [
                      {
                        "scheme": "exact",
                        "network": "eip155:8453",
                        "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                        "amount": "1000",
                        "payTo": "0xa6219b4745cfe59488405bc66083660724af948b",
                        "maxTimeoutSeconds": 600,
                        "extra": {
                          "name": "USD Coin",
                          "version": "2",
                          "assetTransferMethod": "eip3009"
                        }
                      }
                    ],
                    "extensions": {
                      "bazaar": {
                        "info": {
                          "input": {
                            "type": "http",
                            "method": "GET",
                            "queryParams": {
                              "number": "12345678"
                            }
                          },
                          "output": {
                            "type": "json",
                            "example": {
                              "number": 12345678,
                              "hash": "0x..",
                              "timestamp": 1790000000,
                              "tx_count": 120
                            }
                          }
                        },
                        "schema": {
                          "$schema": "https://json-schema.org/draft/2020-12/schema",
                          "type": "object",
                          "properties": {
                            "input": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "http"
                                },
                                "method": {
                                  "type": "string",
                                  "enum": [
                                    "GET",
                                    "HEAD",
                                    "DELETE"
                                  ]
                                },
                                "queryParams": {
                                  "type": "object",
                                  "properties": {
                                    "number": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "required": [
                                "type",
                                "method"
                              ],
                              "additionalProperties": false
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "example": {
                                  "type": "object"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          },
                          "required": [
                            "input"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Settlement failed at the facilitator (not charged)."
          }
        },
        "parameters": [
          {
            "name": "number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "12345678",
            "description": "Example: 12345678"
          }
        ]
      }
    },
    "/api/tx": {
      "get": {
        "summary": "Base transaction decoder",
        "description": "Decode a Base transaction by hash (status, from, to, value, gas). ?hash=0x..\n\n**Price:** $0.0020 USDC on Base per call. Payment is required via x402 v2: an unauthenticated request returns HTTP 402 with a base64 `PAYMENT-REQUIRED` header; retry with a signed `PAYMENT-SIGNATURE` header.",
        "operationId": "sableforge_tx",
        "tags": [
          "chain"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "amount": "0.002",
            "currency": "USD"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid response (settled on-chain).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "hash": "0xabc",
                  "status": 1,
                  "from": "0x..",
                  "to": "0x..",
                  "value": 0.001
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "example": {
                  "x402": {
                    "x402Version": 2,
                    "resource": {
                      "url": "http://sableforge.servehttp.com/api/tx",
                      "description": "Decode a Base transaction by hash (status, from, to, value, gas). ?hash=0x..",
                      "mimeType": "application/json",
                      "serviceName": "base-data-api",
                      "tags": [
                        "base",
                        "tx",
                        "chain"
                      ]
                    },
                    "accepts": [
                      {
                        "scheme": "exact",
                        "network": "eip155:8453",
                        "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                        "amount": "2000",
                        "payTo": "0xa6219b4745cfe59488405bc66083660724af948b",
                        "maxTimeoutSeconds": 600,
                        "extra": {
                          "name": "USD Coin",
                          "version": "2",
                          "assetTransferMethod": "eip3009"
                        }
                      }
                    ],
                    "extensions": {
                      "bazaar": {
                        "info": {
                          "input": {
                            "type": "http",
                            "method": "GET",
                            "queryParams": {
                              "hash": "0xabc"
                            }
                          },
                          "output": {
                            "type": "json",
                            "example": {
                              "hash": "0xabc",
                              "status": 1,
                              "from": "0x..",
                              "to": "0x..",
                              "value": 0.001
                            }
                          }
                        },
                        "schema": {
                          "$schema": "https://json-schema.org/draft/2020-12/schema",
                          "type": "object",
                          "properties": {
                            "input": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "http"
                                },
                                "method": {
                                  "type": "string",
                                  "enum": [
                                    "GET",
                                    "HEAD",
                                    "DELETE"
                                  ]
                                },
                                "queryParams": {
                                  "type": "object",
                                  "properties": {
                                    "hash": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "required": [
                                "type",
                                "method"
                              ],
                              "additionalProperties": false
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "example": {
                                  "type": "object"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          },
                          "required": [
                            "input"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Settlement failed at the facilitator (not charged)."
          }
        },
        "parameters": [
          {
            "name": "hash",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "0x\u2026",
            "description": "Example: 0x\u2026"
          }
        ]
      }
    },
    "/api/addr": {
      "get": {
        "summary": "Base address balances",
        "description": "Address balances on Base (ETH + USDC). ?addr=0x..\n\n**Price:** $0.0020 USDC on Base per call. Payment is required via x402 v2: an unauthenticated request returns HTTP 402 with a base64 `PAYMENT-REQUIRED` header; retry with a signed `PAYMENT-SIGNATURE` header.",
        "operationId": "sableforge_addr",
        "tags": [
          "chain"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "amount": "0.002",
            "currency": "USD"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid response (settled on-chain).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "address": "0xabc",
                  "eth": 1.2,
                  "usdc": 34.5
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "example": {
                  "x402": {
                    "x402Version": 2,
                    "resource": {
                      "url": "http://sableforge.servehttp.com/api/addr",
                      "description": "Address balances on Base (ETH + USDC). ?addr=0x..",
                      "mimeType": "application/json",
                      "serviceName": "base-data-api",
                      "tags": [
                        "base",
                        "balance",
                        "wallet"
                      ]
                    },
                    "accepts": [
                      {
                        "scheme": "exact",
                        "network": "eip155:8453",
                        "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                        "amount": "2000",
                        "payTo": "0xa6219b4745cfe59488405bc66083660724af948b",
                        "maxTimeoutSeconds": 600,
                        "extra": {
                          "name": "USD Coin",
                          "version": "2",
                          "assetTransferMethod": "eip3009"
                        }
                      }
                    ],
                    "extensions": {
                      "bazaar": {
                        "info": {
                          "input": {
                            "type": "http",
                            "method": "GET",
                            "queryParams": {
                              "addr": "0xabc"
                            }
                          },
                          "output": {
                            "type": "json",
                            "example": {
                              "address": "0xabc",
                              "eth": 1.2,
                              "usdc": 34.5
                            }
                          }
                        },
                        "schema": {
                          "$schema": "https://json-schema.org/draft/2020-12/schema",
                          "type": "object",
                          "properties": {
                            "input": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "http"
                                },
                                "method": {
                                  "type": "string",
                                  "enum": [
                                    "GET",
                                    "HEAD",
                                    "DELETE"
                                  ]
                                },
                                "queryParams": {
                                  "type": "object",
                                  "properties": {
                                    "addr": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "required": [
                                "type",
                                "method"
                              ],
                              "additionalProperties": false
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "example": {
                                  "type": "object"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          },
                          "required": [
                            "input"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Settlement failed at the facilitator (not charged)."
          }
        },
        "parameters": [
          {
            "name": "addr",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "0x\u2026",
            "description": "Example: 0x\u2026"
          }
        ]
      }
    },
    "/api/urlcheck": {
      "get": {
        "summary": "URL status & header check",
        "description": "Fetch a URL and report HTTP status + security headers. ?url=https://example.com\n\n**Price:** $0.0020 USDC on Base per call. Payment is required via x402 v2: an unauthenticated request returns HTTP 402 with a base64 `PAYMENT-REQUIRED` header; retry with a signed `PAYMENT-SIGNATURE` header.",
        "operationId": "sableforge_urlcheck",
        "tags": [
          "web"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "amount": "0.002",
            "currency": "USD"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid response (settled on-chain).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "url": "https://example.com",
                  "status": 200,
                  "headers": {
                    "content-type": "text/html"
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "example": {
                  "x402": {
                    "x402Version": 2,
                    "resource": {
                      "url": "http://sableforge.servehttp.com/api/urlcheck",
                      "description": "Fetch a URL and report HTTP status + security headers. ?url=https://example.com",
                      "mimeType": "application/json",
                      "serviceName": "base-data-api",
                      "tags": [
                        "url",
                        "web",
                        "security"
                      ]
                    },
                    "accepts": [
                      {
                        "scheme": "exact",
                        "network": "eip155:8453",
                        "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                        "amount": "2000",
                        "payTo": "0xa6219b4745cfe59488405bc66083660724af948b",
                        "maxTimeoutSeconds": 600,
                        "extra": {
                          "name": "USD Coin",
                          "version": "2",
                          "assetTransferMethod": "eip3009"
                        }
                      }
                    ],
                    "extensions": {
                      "bazaar": {
                        "info": {
                          "input": {
                            "type": "http",
                            "method": "GET",
                            "queryParams": {
                              "url": "https://example.com"
                            }
                          },
                          "output": {
                            "type": "json",
                            "example": {
                              "url": "https://example.com",
                              "status": 200,
                              "headers": {
                                "content-type": "text/html"
                              }
                            }
                          }
                        },
                        "schema": {
                          "$schema": "https://json-schema.org/draft/2020-12/schema",
                          "type": "object",
                          "properties": {
                            "input": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "http"
                                },
                                "method": {
                                  "type": "string",
                                  "enum": [
                                    "GET",
                                    "HEAD",
                                    "DELETE"
                                  ]
                                },
                                "queryParams": {
                                  "type": "object",
                                  "properties": {
                                    "url": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "required": [
                                "type",
                                "method"
                              ],
                              "additionalProperties": false
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "example": {
                                  "type": "object"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          },
                          "required": [
                            "input"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Settlement failed at the facilitator (not charged)."
          }
        },
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "https://example.com",
            "description": "Example: https://example.com"
          }
        ]
      }
    },
    "/api/llm": {
      "post": {
        "summary": "LLM chat completion",
        "description": "LLM chat completion (local 27B model). POST {messages:[{role,content}]} or ?prompt=\n\n**Price:** $0.0020 USDC on Base per call. Payment is required via x402 v2: an unauthenticated request returns HTTP 402 with a base64 `PAYMENT-REQUIRED` header; retry with a signed `PAYMENT-SIGNATURE` header.",
        "operationId": "sableforge_llm",
        "tags": [
          "ai"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "amount": "0.002",
            "currency": "USD"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid response (settled on-chain).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "model": "qwen3.8:27b",
                  "content": "Hello!"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "example": {
                  "x402": {
                    "x402Version": 2,
                    "resource": {
                      "url": "http://sableforge.servehttp.com/api/llm",
                      "description": "LLM chat completion (local 27B model). POST {messages:[{role,content}]} or ?prompt=",
                      "mimeType": "application/json",
                      "serviceName": "base-data-api",
                      "tags": [
                        "llm",
                        "ai",
                        "chat"
                      ]
                    },
                    "accepts": [
                      {
                        "scheme": "exact",
                        "network": "eip155:8453",
                        "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                        "amount": "2000",
                        "payTo": "0xa6219b4745cfe59488405bc66083660724af948b",
                        "maxTimeoutSeconds": 600,
                        "extra": {
                          "name": "USD Coin",
                          "version": "2",
                          "assetTransferMethod": "eip3009"
                        }
                      }
                    ],
                    "extensions": {
                      "bazaar": {
                        "info": {
                          "input": {
                            "type": "http",
                            "method": "POST",
                            "bodyType": "json",
                            "body": {
                              "messages": [
                                {
                                  "role": "user",
                                  "content": "Say hi in one word."
                                }
                              ]
                            }
                          },
                          "output": {
                            "type": "json",
                            "example": {
                              "model": "qwen3.8:27b",
                              "content": "Hello!"
                            }
                          }
                        },
                        "schema": {
                          "$schema": "https://json-schema.org/draft/2020-12/schema",
                          "type": "object",
                          "properties": {
                            "input": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "http"
                                },
                                "method": {
                                  "type": "string",
                                  "enum": [
                                    "POST",
                                    "PUT",
                                    "PATCH"
                                  ]
                                },
                                "bodyType": {
                                  "type": "string",
                                  "enum": [
                                    "json",
                                    "form-data",
                                    "text"
                                  ]
                                },
                                "body": {
                                  "type": "object",
                                  "properties": {
                                    "messages": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "role": {
                                            "type": "string"
                                          },
                                          "content": {
                                            "type": "string"
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              },
                              "required": [
                                "type",
                                "method",
                                "bodyType",
                                "body"
                              ],
                              "additionalProperties": false
                            },
                            "output": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "example": {
                                  "type": "object"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          },
                          "required": [
                            "input"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Settlement failed at the facilitator (not charged)."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "description": "OpenAI-style chat messages.",
                    "items": {
                      "type": "object",
                      "required": [
                        "role",
                        "content"
                      ],
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "system",
                            "user",
                            "assistant"
                          ]
                        },
                        "content": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "max_tokens": {
                    "type": "integer",
                    "default": 512,
                    "maximum": 1024
                  },
                  "temperature": {
                    "type": "number",
                    "default": 0.7
                  }
                }
              },
              "example": {
                "messages": [
                  {
                    "role": "user",
                    "content": "Say hi in one word."
                  }
                ]
              }
            }
          }
        }
      }
    }
  },
  "x-x402": {
    "x402Version": 2,
    "network": "eip155:8453",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "assetName": "USD Coin",
    "assetVersion": "2",
    "assetTransferMethod": "eip3009",
    "payTo": "0xa6219b4745cfe59488405bc66083660724af948b",
    "facilitator": "https://facilitator.payai.network",
    "maxTimeoutSeconds": 600,
    "paymentRequiredHeader": "PAYMENT-REQUIRED",
    "paymentSignatureHeader": "PAYMENT-SIGNATURE",
    "paymentResponseHeader": "PAYMENT-RESPONSE",
    "discovery": "http://sableforge.servehttp.com/.well-known/x402"
  }
}
