{
  "openapi": "3.1.0",
  "info": {
    "title": "RFS Stablecoin Yield Risk Index (SYRI)",
    "version": "SYRI-2026.2",
    "summary": "Machine-payable risk scores for stablecoin yield venues.",
    "description": "RFS Stablecoin Yield Risk Index (SYRI): a 0–100 risk score and band (Conservative / Moderate / Speculative) for a stablecoin yield venue. Call BEFORE parking or routing stablecoins into a lending pool, RWA, or yield product to check its risk. Covers Aave, Morpho, Ondo, Ethena, Sky, Reserve, and more. By RFS Consulting.\n\n## Payment\n\nThis API uses **x402**. Request a resource, receive `402 Payment Required` with terms, pay in USDC on base, and retry with an `X-PAYMENT` header. Most x402 client libraries do this automatically. There is no account, API key, or signup.\n\nA 402 is the expected first response, not an error.\n\n## Data provenance\n\nAPY and TVL are measured and refreshed twice daily (DeFiLlama pool data, or on-chain token supply for $1-pegged instruments). The composite score and risk band are RFS analyst judgement, revised on review rather than on a schedule.",
    "contact": {
      "name": "RFS Consulting",
      "url": "https://rfsconsultingglobal.com"
    },
    "license": {
      "name": "Single-call, internal-use licence. Redistribution prohibited."
    }
  },
  "servers": [
    {
      "url": "https://syri.rfsrisk.ai"
    }
  ],
  "tags": [
    {
      "name": "scores",
      "description": "risk, stablecoin, yield, defi, risk-scoring, due-diligence, syri"
    }
  ],
  "paths": {
    "/api/catalog": {
      "get": {
        "operationId": "getCatalog",
        "summary": "List sellable venues, pricing, payment terms and data freshness",
        "description": "Free. No payment required. Read this first to decide whether to buy.",
        "tags": [
          "scores"
        ],
        "responses": {
          "200": {
            "description": "The sellable universe and how to buy from it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "service": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "pricing": {
                      "type": "object"
                    },
                    "payment": {
                      "type": "object"
                    },
                    "response": {
                      "type": "object"
                    },
                    "freshness": {
                      "type": "object"
                    },
                    "venue_count": {
                      "type": "integer"
                    },
                    "venues": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/score": {
      "get": {
        "operationId": "getScore",
        "summary": "Risk score for a stablecoin yield venue (paid)",
        "description": "Returns `402 Payment Required` with x402 terms until paid. $0.10 USDC per entity. Entities outside the catalog return 404 and are never charged.",
        "tags": [
          "scores"
        ],
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": true,
            "description": "Stablecoin yield venue to score — slug, token, protocol, or alias.",
            "schema": {
              "type": "string",
              "examples": [
                "usdc-aave-v3",
                "ousg",
                "eusd",
                "usdc-morpho",
                "sdai"
              ]
            }
          },
          {
            "name": "entities",
            "in": "query",
            "required": false,
            "description": "Batch: comma-separated slugs. Priced per entity, max 25.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment accepted. The score.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entity": {
                      "type": "string"
                    },
                    "composite_score": {
                      "type": "number",
                      "description": "SYRI 0–100; higher = lower risk."
                    },
                    "tier": {
                      "type": "string",
                      "enum": [
                        "Conservative",
                        "Moderate",
                        "Speculative"
                      ]
                    },
                    "tier_label": {
                      "type": "string"
                    },
                    "view": {
                      "type": "string"
                    },
                    "methodology_version": {
                      "type": "string"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "license": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "entity",
                    "composite_score",
                    "tier",
                    "as_of"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Under x402 v2 the terms are NOT in the body — the body is `{}` and the requirements (scheme, network, asset, payTo, amount, extensions) are base64-encoded JSON in the `Payment-Required` response header. Decode that header, pay, and retry the same request with an X-PAYMENT header.",
            "headers": {
              "Payment-Required": {
                "description": "Base64-encoded JSON payment requirements. This is where the terms live in x402 v2.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Empty; see the Payment-Required header."
                }
              }
            }
          },
          "404": {
            "description": "Entity is not in the sellable catalog, or the requested view is not sold. Never charged.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "unknown": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "hint": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Per-payer cap exceeded: 60 paid calls/hour and 50 distinct entities/hour. The response carries Retry-After (seconds) and a machine-readable body.",
            "headers": {
              "Retry-After": {
                "description": "Seconds until the cap resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Limit": {
                "description": "Paid calls allowed per hour.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Calls left in this window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "detail": {
                      "type": "string"
                    },
                    "retry_after_seconds": {
                      "type": "integer"
                    },
                    "limits": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-operations": {
    "status_endpoint": "https://syri.rfsrisk.ai/healthz",
    "rate_limits": {
      "paid_calls_per_hour_per_payer": 60,
      "distinct_entities_per_hour_per_payer": 50,
      "batch_max": 25,
      "headers": [
        "RateLimit-Limit",
        "RateLimit-Remaining",
        "RateLimit-Reset",
        "Retry-After"
      ]
    },
    "response_headers": {
      "X-API-Version": "Methodology version; changes when scoring methodology changes.",
      "X-Request-Id": "Quote this when reporting a problem."
    },
    "data_refresh": "twice daily",
    "versioning": "Methodology version is carried in info.version and the X-API-Version header."
  },
  "x-x402": {
    "protocol": "x402",
    "version": 2,
    "scheme": "exact",
    "network": "eip155:8453",
    "network_name": "base",
    "terms_location": "Payment-Required response header (base64 JSON)",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "asset_symbol": "USDC",
    "asset_decimals": 6,
    "amount_atomic": "100000",
    "price_usd": 0.1,
    "pay_to": "0xB178867dE06b34524b528bF79eC98396DF8bDAc9",
    "discovery": "https://syri.rfsrisk.ai/.well-known/x402.json"
  }
}