{
  "name": "hd-scaling",
  "title": "Ravencraft HD & 16:9 Scaling Service",
  "version": "1.0.0",
  "base_url": "https://services.ravencraft.dk/hd-scaling",
  "description": "Scales and embeds any source image proportionally onto a 16:9 canvas in HD (1280x720), 2K (1920x1080), or 4K (3840x2160) without distortion.",
  "auth": { "type": "none" },
  "constraints": {
    "max_input_bytes": 15728640,
    "allowed_hosts": ["services.ravencraft.dk", "ravencraft.dk"],
    "supported_sizes": ["HD", "2K", "4K"],
    "bg_strategies": ["blur", "edge", "<HEX>"]
  },
  "endpoints": [
    {
      "method": "GET",
      "path": "/",
      "returns": "image/webp",
      "summary": "Scale image from an allowlisted URL to a 16:9 canvas.",
      "query_params": {
        "image_url": { "type": "string", "required": true, "example": "https://services.ravencraft.dk/placeholder?w=400&h=400" },
        "size": { "type": "string", "default": "HD", "enum": ["HD", "2K", "4K"] },
        "bg": { "type": "string", "default": "blur", "description": "blur, edge, or 6-character hex code" },
        "tenant_id": { "type": "string" },
        "user_id": { "type": "string" }
      }
    },
    {
      "method": "POST",
      "path": "/",
      "returns": "image/webp",
      "summary": "Upload and scale a local image file onto a 16:9 canvas.",
      "body": {
        "type": "multipart/form-data",
        "fields": {
          "image_file": { "type": "file", "note": "Image file (max 15MB)" },
          "size": { "type": "string", "default": "HD", "enum": ["HD", "2K", "4K"] },
          "bg": { "type": "string", "default": "blur" }
        }
      }
    },
    {
      "method": "GET",
      "path": "/ui",
      "returns": "text/html",
      "summary": "Interactive UI for testing scaling and background options."
    },
    {
      "method": "GET",
      "path": "/health.php",
      "returns": "application/json",
      "summary": "Health check."
    },
    {
      "method": "GET",
      "path": "/manifest.json",
      "returns": "application/json",
      "summary": "Machine-readable service description."
    }
  ]
}
