{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/topxea-com/json-schema/topxea-com-pricing-model-schema.json",
  "title": "PricingModel",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ai.topxea.com-openapi.json#/components/schemas/PricingModel",
  "type": "object",
  "properties": {
    "model_name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "notice": {
      "type": "string"
    },
    "enable_groups": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "supported_endpoint_types": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "route_prices": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/RoutePrice"
      }
    },
    "reference_price": {
      "$ref": "#/$defs/RoutePrice"
    },
    "reference_price_source": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "verified_at": {
          "type": "string"
        },
        "model": {
          "type": "string"
        }
      }
    },
    "auto_route": {
      "type": "string"
    },
    "context_window": {
      "type": "integer",
      "description": "Input context window in tokens; omitted when unknown or not applicable."
    },
    "max_output": {
      "type": "integer",
      "description": "Maximum output tokens; omitted when unknown or not applicable."
    }
  },
  "additionalProperties": true,
  "$defs": {
    "RoutePrice": {
      "type": "object",
      "properties": {
        "unit": {
          "type": "string",
          "enum": [
            "per_million_tokens",
            "per_image",
            "per_second",
            "per_request"
          ]
        },
        "input": {
          "type": "number"
        },
        "output": {
          "type": "number"
        },
        "cache_read": {
          "type": "number"
        },
        "cache_write": {
          "type": "number"
        },
        "cache_write_1h": {
          "type": "number"
        },
        "long_context": {
          "type": "object",
          "properties": {
            "min_input_tokens": {
              "type": "integer"
            },
            "input": {
              "type": "number"
            },
            "output": {
              "type": "number"
            }
          },
          "additionalProperties": true
        },
        "sizes": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          }
        },
        "resolutions": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          }
        },
        "unit_price": {
          "type": "number"
        }
      },
      "additionalProperties": true
    }
  }
}