{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://loop.firmiana.si/api/v1/schemas/providers.schema.json",
  "title": "Model makers (api/v1/providers.json)",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "version", "generated_at", "license", "providers"],
  "properties": {
    "schema": { "type": "string", "format": "uri" }, "version": { "const": 1 }, "generated_at": { "type": "string", "format": "date-time" }, "license": { "const": "CC-BY-4.0" },
    "providers": { "type": "array", "items": { "$ref": "#/$defs/provider" } }
  },
  "$defs": {
    "provider": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "name", "name_zh", "region", "website", "pricing_pages", "model_count", "status_page", "status", "url"],
      "properties": {
        "id": { "type": "string" },
        "name": { "type": "string" },
        "name_zh": { "type": ["string", "null"] },
        "region": { "enum": ["intl", "cn"] },
        "website": { "type": "string", "format": "uri" },
        "pricing_pages": { "type": "array", "items": { "type": "string", "format": "uri" } },
        "model_count": { "type": "integer" },
        "status_page": { "type": ["string", "null"], "format": "uri" },
        "status": { "enum": ["ok", "degraded", "outage", "unknown", null], "description": "API state at build time; null when the provider has no official status page" },
        "url": { "type": "string", "format": "uri" }
      }
    }
  }
}
