{
  "$defs": {
    "DataPolicy": {
      "additionalProperties": false,
      "properties": {
        "allows_pii": {
          "title": "Allows Pii",
          "type": "boolean"
        },
        "allows_sensitive": {
          "title": "Allows Sensitive",
          "type": "boolean"
        },
        "retention": {
          "$ref": "#/$defs/Retention"
        }
      },
      "required": [
        "allows_pii",
        "allows_sensitive",
        "retention"
      ],
      "title": "DataPolicy",
      "type": "object"
    },
    "JsonValue": {},
    "OpenRouterRouting": {
      "additionalProperties": false,
      "properties": {
        "data_collection": {
          "enum": [
            "allow",
            "deny"
          ],
          "title": "Data Collection",
          "type": "string"
        },
        "zdr": {
          "title": "Zdr",
          "type": "boolean"
        }
      },
      "required": [
        "data_collection",
        "zdr"
      ],
      "title": "OpenRouterRouting",
      "type": "object"
    },
    "ProviderCapabilitiesSpec": {
      "additionalProperties": false,
      "properties": {
        "json_schema_output": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Json Schema Output"
        },
        "tools": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Tools"
        }
      },
      "title": "ProviderCapabilitiesSpec",
      "type": "object"
    },
    "ProviderKind": {
      "enum": [
        "catalog",
        "code",
        "openai_compatible"
      ],
      "type": "string"
    },
    "ProviderLimits": {
      "additionalProperties": false,
      "properties": {
        "concurrency": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Concurrency"
        },
        "rpm": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Rpm"
        }
      },
      "title": "ProviderLimits",
      "type": "object"
    },
    "ProviderNameField": {
      "pattern": "^[a-z][a-z0-9_-]{0,62}$",
      "type": "string"
    },
    "RateLimitMode": {
      "enum": [
        "auto",
        "fixed",
        "fail"
      ],
      "type": "string"
    },
    "Retention": {
      "enum": [
        "zero",
        "logged",
        "unknown"
      ],
      "title": "Retention",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "properties": {
    "api_key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Api Key"
    },
    "base_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Base Url"
    },
    "capabilities": {
      "anyOf": [
        {
          "$ref": "#/$defs/ProviderCapabilitiesSpec"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "data_policy": {
      "$ref": "#/$defs/DataPolicy"
    },
    "id": {
      "$ref": "#/$defs/ProviderNameField"
    },
    "kind": {
      "$ref": "#/$defs/ProviderKind",
      "default": "catalog"
    },
    "limits": {
      "anyOf": [
        {
          "$ref": "#/$defs/ProviderLimits"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "on_rate_limit": {
      "$ref": "#/$defs/RateLimitMode",
      "default": "auto"
    },
    "params": {
      "anyOf": [
        {
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Params"
    },
    "retry_attempts": {
      "anyOf": [
        {
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Retry Attempts"
    },
    "retry_wait_seconds": {
      "anyOf": [
        {
          "exclusiveMinimum": 0,
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Retry Wait Seconds"
    },
    "routing": {
      "anyOf": [
        {
          "$ref": "#/$defs/OpenRouterRouting"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "run": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Run"
    }
  },
  "required": [
    "id",
    "data_policy"
  ],
  "title": "ProviderSpec",
  "type": "object"
}
