{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://unpkg.com/@oai404iao/pi-codex-minimal-tools@1/models.schema.json",
  "title": "@oai404iao/pi-codex-minimal-tools model catalog overrides",
  "description": "Per-model Codex protocol and tool capability profiles. User entries override bundled entries by exact provider/model id.",
  "type": "object",
  "additionalProperties": false,
  "required": ["version", "models"],
  "properties": {
    "$schema": {
      "type": "string",
      "description": "JSON Schema URL used by editors for validation and completion.",
      "default": "https://unpkg.com/@oai404iao/pi-codex-minimal-tools@1/models.schema.json"
    },
    "version": {
      "const": 1,
      "description": "Model catalog format version.",
      "default": 1
    },
    "models": {
      "type": "array",
      "description": "Exact per-model profiles. Duplicate ids in one user file are rejected.",
      "items": {
        "$ref": "#/$defs/model"
      },
      "default": []
    }
  },
  "$defs": {
    "modelId": {
      "type": "string",
      "pattern": "^[^\\s/]+/\\S+$"
    },
    "model": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id"],
      "properties": {
        "id": {
          "$ref": "#/$defs/modelId",
          "description": "Exact provider/model id, for example openai/gpt-5.5."
        },
        "extends": {
          "$ref": "#/$defs/modelId",
          "description": "Optional parent profile. The parent is deep-merged first; arrays are replaced."
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether this profile can activate extension behavior."
        },
        "responses": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "providerShim": {
              "type": "boolean",
              "description": "Use this extension's Codex Responses serializer/parser. The Pi model must use api openai-responses or openai-codex-responses."
            },
            "endpoint": {
              "enum": ["auto", "openai", "codex"],
              "description": "Endpoint and authentication shape."
            },
            "mode": {
              "enum": ["standard", "lite"],
              "description": "Standard Responses or the internal Codex Responses Lite envelope."
            },
            "reasoningSummary": {
              "enum": ["auto", "concise", "detailed", "none"],
              "description": "Reasoning summary mode. none omits reasoning.summary; absent defaults to auto in Standard mode and none in Lite mode."
            },
            "systemPromptPlacement": {
              "enum": ["instructions", "developer"],
              "description": "Standard-mode prompt placement. Lite always uses a developer message."
            },
            "transport": {
              "enum": ["sse", "websocket", "websocket-cached", "auto"],
              "description": "Responses transport and continuation strategy."
            },
            "websocketPrewarm": {
              "type": "boolean",
              "description": "At session startup, schedule one best-effort generate:false prewarm request containing only the stable system/tool envelope."
            }
          }
        },
        "tools": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "parallelCalls": {
              "type": "boolean",
              "description": "Whether the request permits parallel tool calls. Lite always forces false."
            },
            "applyPatch": {
              "description": "Disable apply_patch, expose a JSON function tool, or use the Codex freeform custom tool.",
              "enum": [false, "function", "custom"],
              "enumDescriptions": [
                "Do not expose an apply_patch tool.",
                "Expose apply_patch as a regular JSON function tool.",
                "Expose apply_patch as the Codex freeform custom tool."
              ]
            },
            "webSearch": {
              "description": "Disable web search or choose hosted Responses search versus standalone Codex web.run.",
              "if": {
                "type": "boolean"
              },
              "then": {
                "const": false
              },
              "else": {
                "type": "object"
              },
              "defaultSnippets": [
                {
                  "label": "Disable web search",
                  "description": "Do not expose web search for this model.",
                  "body": false
                },
                {
                  "label": "Hosted web search",
                  "description": "Use the server-executed Responses web_search tool.",
                  "body": {
                    "implementation": "hosted"
                  }
                },
                {
                  "label": "Standalone web search",
                  "description": "Expose web.run and call the Codex alpha/search endpoint.",
                  "body": {
                    "implementation": "standalone"
                  }
                }
              ],
              "additionalProperties": false,
              "required": ["implementation"],
              "properties": {
                "implementation": {
                  "enum": ["hosted", "standalone"],
                  "enumDescriptions": [
                    "Use the server-executed Responses web_search tool.",
                    "Expose web.run and call the Codex alpha/search endpoint."
                  ]
                },
                "contentTypes": {
                  "type": "array",
                  "description": "Search modalities advertised or accepted by this model.",
                  "minItems": 1,
                  "items": {
                    "enum": ["text", "image"]
                  },
                  "uniqueItems": true
                }
              }
            },
            "imageGeneration": {
              "description": "Disable image generation, use hosted Responses image_generation, or use standalone Codex Images endpoints.",
              "enum": [false, "hosted", "standalone"],
              "enumDescriptions": [
                "Do not expose an image-generation tool.",
                "Use the hosted Responses image_generation tool.",
                "Expose image_gen.imagegen and call the standalone Codex Images endpoints."
              ]
            },
            "viewImage": {
              "type": "boolean",
              "description": "Expose the local view_image tool when the Pi model accepts image input."
            }
          }
        },
        "compaction": {
          "enum": ["pi", "responses", "responses-compact"],
          "description": "Pi summary compaction, Codex remote compaction v2, or the legacy /responses/compact endpoint."
        },
        "fast": {
          "description": "Disable Fast mode for this model or configure its service tier and optional usage-cost multiplier.",
          "if": {
            "type": "boolean"
          },
          "then": {
            "const": false
          },
          "else": {
            "type": "object"
          },
          "defaultSnippets": [
            {
              "label": "Disable Fast mode",
              "description": "Do not enable a Fast service tier for this model.",
              "body": false
            },
            {
              "label": "Configure Fast mode",
              "description": "Configure the Responses service tier used by the global Fast toggle.",
              "body": {
                "serviceTier": "priority"
              }
            }
          ],
          "additionalProperties": false,
          "required": ["serviceTier"],
          "properties": {
            "serviceTier": {
              "type": "string",
              "minLength": 1,
              "description": "Responses service_tier value sent when the global Fast toggle is enabled."
            },
            "costMultiplier": {
              "type": "number",
              "exclusiveMinimum": 0,
              "description": "Optional multiplier applied to Pi's reported request cost for this tier."
            }
          }
        }
      }
    }
  }
}
