{
  "openapi": "3.1.0",
  "info": {
    "title": "Klisten ModelRoute Discovery",
    "version": "0.1.0",
    "description": "Metadata-only discovery beta. No authentication, model execution or payments. One shared daily source collection. Recompute freshness from expires_at; source_status is export-time information. A listing is not a quality, availability or complete-price guarantee. Filter presence=listed and check each offering expiry."
  },
  "servers": [
    {
      "url": "https://api.klisten.co.kr"
    }
  ],
  "paths": {
    "/v1/modelroute/catalog": {
      "get": {
        "operationId": "getModelRouteCatalog",
        "summary": "Read the last published model metadata snapshot",
        "responses": {
          "200": {
            "description": "Last published snapshot; may be stale. Check expiry before using.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Catalog"
                }
              }
            }
          },
          "404": {
            "description": "No published catalog"
          },
          "503": {
            "description": "Temporarily unavailable"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Catalog": {
        "type": "object",
        "required": [
          "observed_at",
          "expires_at",
          "schema_version",
          "stage",
          "snapshot_id",
          "source_url",
          "source_status",
          "counts",
          "offerings"
        ],
        "properties": {
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "schema_version": {
            "const": "modelroute.public-catalog.v1"
          },
          "stage": {
            "const": "discovery-beta"
          },
          "snapshot_id": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "source_url": {
            "type": "string",
            "format": "uri"
          },
          "source_status": {
            "enum": [
              "current",
              "stale",
              "not_yet_valid"
            ]
          },
          "counts": {
            "type": "object",
            "description": "All retained records, including missing records; not currently available model counts.",
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "free": {
                "type": "integer",
                "minimum": 0
              },
              "paid": {
                "type": "integer",
                "minimum": 0
              },
              "unknown": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "offerings": {
            "type": "array",
            "maxItems": 10000,
            "items": {
              "$ref": "#/components/schemas/Offering"
            }
          }
        }
      },
      "Offering": {
        "type": "object",
        "required": [
          "id",
          "name",
          "pricing_class",
          "presence",
          "rate_unit",
          "issues",
          "context_tokens",
          "max_output_tokens",
          "input_rate",
          "output_rate",
          "fixed_micro_usd",
          "observed_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "pricing_class": {
            "enum": [
              "free",
              "paid",
              "unknown"
            ]
          },
          "presence": {
            "enum": [
              "listed",
              "missing"
            ]
          },
          "rate_unit": {
            "const": "micro_usd_per_million_tokens"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "context_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "max_output_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "input_rate": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "output_rate": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "fixed_micro_usd": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  }
}
