{
  "id": "xai",
  "enabledByDefault": true,
  "providers": ["xai"],
  "providerAuthEnvVars": {
    "xai": ["XAI_API_KEY"]
  },
  "providerAuthChoices": [
    {
      "provider": "xai",
      "method": "api-key",
      "choiceId": "xai-api-key",
      "choiceLabel": "xAI API key",
      "groupId": "xai",
      "groupLabel": "xAI (Grok)",
      "groupHint": "API key",
      "optionKey": "xaiApiKey",
      "cliFlag": "--xai-api-key",
      "cliOption": "--xai-api-key <key>",
      "cliDescription": "xAI API key"
    }
  ],
  "uiHints": {
    "webSearch.apiKey": {
      "label": "Grok Search API Key",
      "help": "xAI API key for Grok web search (fallback: XAI_API_KEY env var).",
      "sensitive": true
    },
    "webSearch.model": {
      "label": "Grok Search Model",
      "help": "Grok model override for web search."
    },
    "webSearch.inlineCitations": {
      "label": "Inline Citations",
      "help": "Include inline markdown citations in Grok responses."
    },
    "codeExecution.enabled": {
      "label": "Enable Code Execution",
      "help": "Enable the code_execution tool for remote xAI sandbox analysis."
    },
    "xSearch.enabled": {
      "label": "Enable X Search",
      "help": "Enable the x_search tool for searching X posts with xAI."
    },
    "xSearch.model": {
      "label": "X Search Model",
      "help": "xAI model override for x_search."
    },
    "xSearch.inlineCitations": {
      "label": "X Search Inline Citations",
      "help": "Keep inline markdown citations from xAI in x_search responses when available."
    },
    "xSearch.maxTurns": {
      "label": "X Search Max Turns",
      "help": "Optional max internal tool turns xAI may use per x_search request."
    },
    "xSearch.timeoutSeconds": {
      "label": "X Search Timeout",
      "help": "Timeout in seconds for x_search requests."
    },
    "xSearch.cacheTtlMinutes": {
      "label": "X Search Cache TTL",
      "help": "Cache TTL in minutes for x_search results."
    },
    "codeExecution.model": {
      "label": "Code Execution Model",
      "help": "xAI model override for code_execution."
    },
    "codeExecution.maxTurns": {
      "label": "Code Execution Max Turns",
      "help": "Optional max internal tool turns xAI may use for code_execution."
    },
    "codeExecution.timeoutSeconds": {
      "label": "Code Execution Timeout",
      "help": "Timeout in seconds for code_execution requests."
    }
  },
  "contracts": {
    "webSearchProviders": ["grok"],
    "videoGenerationProviders": ["xai"],
    "tools": ["code_execution", "x_search"]
  },
  "configSchema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "webSearch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "apiKey": {
            "type": ["string", "object"]
          },
          "model": {
            "type": "string"
          },
          "inlineCitations": {
            "type": "boolean"
          }
        }
      },
      "xSearch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "model": {
            "type": "string"
          },
          "inlineCitations": {
            "type": "boolean"
          },
          "maxTurns": {
            "type": "number"
          },
          "timeoutSeconds": {
            "type": "number"
          },
          "cacheTtlMinutes": {
            "type": "number"
          }
        }
      },
      "codeExecution": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "model": {
            "type": "string"
          },
          "maxTurns": {
            "type": "number"
          },
          "timeoutSeconds": {
            "type": "number"
          }
        }
      }
    }
  }
}
