{
  "openapi": "3.1.0",
  "info": {
    "title": "FreeTier Sentinel API",
    "version": "1.0.0",
    "summary": "Curated free-tier limits for cloud, DB, AI APIs, email — paid per-call via x402 (USDC on Base).",
    "description": "Machine-readable API for AI agents and developer tools that need accurate, structured free-tier limit data. Paid endpoints accept x402 protocol payments in USDC on Base. The /v1/providers endpoint is free.\n\nWhy this exists: AI agents building tooling (e.g., 'should I use Cloudflare or Vercel for this workload?') need authoritative free-tier limit data. Scraping is unreliable. This API is a curated, paid alternative.",
    "contact": {
      "name": "FreeTier Sentinel",
      "url": "https://freetier-sentinel.dev"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://freetier-sentinel.dev/terms"
    }
  },
  "servers": [
    {
      "url": "https://freetier-sentinel.dev",
      "description": "Production"
    }
  ],
  "x-payment": {
    "protocol": "x402",
    "version": 1,
    "network": "eip155:8453",
    "networkAlias": "base",
    "asset": "USDC",
    "assetContract": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "facilitator": "https://api.cdp.coinbase.com/platform/v2/x402",
    "bazaarIndexed": true
  },
  "paths": {
    "/v1/providers": {
      "get": {
        "summary": "List all providers (FREE)",
        "description": "Returns providers we have curated data for, grouped by category. No payment required.",
        "responses": {
          "200": {
            "description": "Provider listing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvidersResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/limits/{provider}": {
      "get": {
        "summary": "All free-tier limits for a provider (PAID)",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Provider name (e.g. cloudflare, aws, gcp)"
          }
        ],
        "x-x402-price": {
          "amount": 0.005,
          "currency": "USDC"
        },
        "responses": {
          "200": {
            "description": "All limits for the provider",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LimitsResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required (see Link header for x402 details)"
          },
          "404": {
            "description": "Unknown provider"
          }
        }
      }
    },
    "/v1/cloud/{provider}/limits": {
      "get": {
        "summary": "Cloud + CI limits for a provider (PAID)",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-x402-price": {
          "amount": 0.005,
          "currency": "USDC"
        },
        "responses": {
          "200": {
            "description": "Cloud limits"
          },
          "402": {
            "description": "Payment required"
          },
          "404": {
            "description": "No data"
          }
        }
      }
    },
    "/v1/ai/{provider}/limits": {
      "get": {
        "summary": "AI/LLM API limits for a provider (PAID)",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-x402-price": {
          "amount": 0.005,
          "currency": "USDC"
        },
        "responses": {
          "200": {
            "description": "AI limits"
          },
          "402": {
            "description": "Payment required"
          },
          "404": {
            "description": "No data"
          }
        }
      }
    },
    "/v1/compare": {
      "get": {
        "summary": "Multi-provider comparison (PAID)",
        "parameters": [
          {
            "name": "providers",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated list (≥2)"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "cloud",
                "ai",
                "db",
                "email",
                "storage",
                "ci"
              ]
            }
          }
        ],
        "x-x402-price": {
          "amount": 0.01,
          "currency": "USDC"
        },
        "responses": {
          "200": {
            "description": "Comparison"
          },
          "400": {
            "description": "Invalid query"
          },
          "402": {
            "description": "Payment required"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "FreeTierLimit": {
        "type": "object",
        "required": [
          "provider",
          "service",
          "category",
          "metric",
          "limit",
          "unit",
          "period",
          "source_url",
          "as_of"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "example": "cloudflare"
          },
          "service": {
            "type": "string",
            "example": "workers"
          },
          "category": {
            "type": "string",
            "enum": [
              "cloud",
              "ai",
              "db",
              "email",
              "storage",
              "ci"
            ]
          },
          "metric": {
            "type": "string",
            "example": "requests"
          },
          "limit": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "example": 100000
          },
          "unit": {
            "type": "string",
            "example": "requests"
          },
          "period": {
            "type": "string",
            "enum": [
              "second",
              "minute",
              "hour",
              "day",
              "month",
              "lifetime"
            ]
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "source_url": {
            "type": "string",
            "format": "uri"
          },
          "as_of": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "ProvidersResponse": {
        "type": "object",
        "properties": {
          "providers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "by_category": {
            "type": "object"
          },
          "total_records": {
            "type": "integer"
          },
          "pricing": {
            "type": "object"
          }
        }
      },
      "LimitsResponse": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string"
          },
          "limits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FreeTierLimit"
            }
          },
          "count": {
            "type": "integer"
          },
          "schema_version": {
            "type": "integer"
          }
        }
      }
    }
  }
}