{
  "openapi": "3.1.0",
  "info": {
    "title": "Compute Cafe Panel API",
    "version": "1.0.0",
    "description": "Compute Cafe GPU price panel: observed on-demand cloud GPU rental prices across 100+ providers, every row linked to the published source it was read from. Surfaces: the row-level listings table (listings-full.json), the daily price-history index (history-index.json), the provider rollup (providers.json), collector status (meta.json), and a keyless read-only MCP server (https://www.compute.cafe/mcp) for bounded row-level answers. Live rows refresh hourly; the full panel every two hours.",
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    }
  },
  "servers": [
    {
      "url": "https://www.compute.cafe"
    }
  ],
  "paths": {
    "/data/providers.json": {
      "get": {
        "operationId": "listProviders",
        "summary": "Provider-level rollup",
        "description": "Panel membership, listing counts, price range, and embedded listing summaries per provider.",
        "responses": {
          "200": {
            "description": "Array of providers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Provider"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/data/meta.json": {
      "get": {
        "operationId": "getMeta",
        "summary": "Collector status and receipts",
        "description": "Last refresh time, per-provider connector status (ok / carried over / failed), and the FX receipt. Check here first for panel freshness and counts.",
        "responses": {
          "200": {
            "description": "Collector metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Meta"
                }
              }
            }
          }
        }
      }
    },
    "/data/listings-full.json": {
      "get": {
        "operationId": "listListings",
        "summary": "Full row-level listings table",
        "description": "Every current listing with provider, GPU model/count, per-hour price, currency, location, availability, and the receipt (source_url, observed_at). /data/listings-essential.json is a byte-identical compatibility alias.",
        "responses": {
          "200": {
            "description": "Array of listings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Listing"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/data/history-index.json": {
      "get": {
        "operationId": "getHistoryIndex",
        "summary": "Daily price-history index",
        "description": "Per-listing daily USD price series, folded from the collector's own snapshots. Full snapshots also live in the public repo under data/history/.",
        "responses": {
          "200": {
            "description": "History index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcpRpc",
        "summary": "MCP server (streamable HTTP, JSON-RPC 2.0)",
        "description": "Keyless, read-only Model Context Protocol endpoint. Tools: list_providers, search_listings, cheapest, get_meta, get_history. POST JSON-RPC 2.0 with Accept: application/json, text/event-stream.",
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Listing": {
        "type": "object",
        "required": [
          "id",
          "provider_slug",
          "provider_name",
          "gpu_model",
          "gpu_count",
          "price_per_hour",
          "location",
          "availability",
          "listing_url",
          "first_seen",
          "last_seen"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable listing id derived from provider, GPU, count, and location."
          },
          "provider_slug": {
            "type": "string"
          },
          "provider_name": {
            "type": "string"
          },
          "provider_url": {
            "type": "string",
            "format": "uri"
          },
          "referral_url": {
            "type": "string",
            "format": "uri",
            "description": "Disclosed affiliate link when the provider has a program; otherwise absent. Never affects ordering."
          },
          "gpu_model": {
            "type": "string"
          },
          "gpu_count": {
            "type": "integer",
            "minimum": 1
          },
          "vram_gb": {
            "type": "number",
            "description": "VRAM per GPU in GB."
          },
          "price_per_hour": {
            "type": "number",
            "description": "USD per hour for the listed configuration."
          },
          "price_per_hour_native": {
            "type": "number",
            "description": "Price per hour in the provider's native currency."
          },
          "price_per_hour_usd": {
            "type": "number",
            "description": "Present only on non-USD rows; the converted USD price with its FX receipt in /data/meta.json."
          },
          "currency": {
            "type": "string",
            "description": "ISO code of the native currency (USD, EUR, INR)."
          },
          "location": {
            "type": "string"
          },
          "availability": {
            "type": "string",
            "enum": [
              "available",
              "catalog"
            ],
            "description": "available = live marketplace observation; catalog = published rate card."
          },
          "price_bucket": {
            "type": "integer",
            "description": "Internal display bucket 0-5."
          },
          "listing_url": {
            "type": "string",
            "format": "uri",
            "description": "Direct link to rent or view this listing at the provider."
          },
          "source_type": {
            "type": "string",
            "enum": [
              "live-api",
              "catalog"
            ],
            "description": "How this row was collected."
          },
          "source_url": {
            "type": "string",
            "description": "The exact source this row was read from. The receipt."
          },
          "observed_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the source was read."
          },
          "first_seen": {
            "type": "string",
            "format": "date-time"
          },
          "last_seen": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Provider": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "url",
          "type",
          "listing_count",
          "min_price",
          "max_price",
          "listings"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "type": {
            "type": "string",
            "description": "Provider category, e.g. cloud or marketplace."
          },
          "listing_count": {
            "type": "integer"
          },
          "min_price": {
            "type": "number",
            "description": "Lowest USD hourly price in the provider's current rows."
          },
          "max_price": {
            "type": "number"
          },
          "listings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "gpu_model": {
                  "type": "string"
                },
                "price_per_hour": {
                  "type": "number"
                },
                "location": {
                  "type": "string"
                },
                "availability": {
                  "type": "string",
                  "enum": [
                    "available",
                    "catalog"
                  ]
                }
              }
            }
          }
        }
      },
      "Meta": {
        "type": "object",
        "required": [
          "updated_at",
          "fx",
          "providers"
        ],
        "properties": {
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last collection run."
          },
          "fx": {
            "type": "object",
            "properties": {
              "pair": {
                "type": "string"
              },
              "inr_per_usd": {
                "type": "number"
              },
              "source_url": {
                "type": "string",
                "format": "uri"
              },
              "observed_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "providers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "slug": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "description": "ok, carried over, or failed."
                },
                "source_type": {
                  "type": "string"
                },
                "observed_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "listings": {
                  "type": "integer"
                },
                "source_url": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}