{
  "id": "xai",
  "activation": {
    "onStartup": false
  },
  "enabledByDefault": true,
  "providers": [
    "xai"
  ],
  "providerDiscoveryEntry": "./provider-discovery.ts",
  "modelIdNormalization": {
    "providers": {
      "xai": {
        "aliases": {
          "grok-4-fast-reasoning": "grok-4-fast",
          "grok-4-1-fast-reasoning": "grok-4-1-fast",
          "grok-4.20-experimental-beta-0304-reasoning": "grok-4.20-beta-latest-reasoning",
          "grok-4.20-experimental-beta-0304-non-reasoning": "grok-4.20-beta-latest-non-reasoning",
          "grok-4.20-reasoning": "grok-4.20-beta-latest-reasoning",
          "grok-4.20-non-reasoning": "grok-4.20-beta-latest-non-reasoning"
        }
      }
    }
  },
  "providerEndpoints": [
    {
      "endpointClass": "xai-native",
      "hosts": [
        "api.x.ai",
        "api.grok.x.ai"
      ]
    }
  ],
  "providerRequest": {
    "providers": {
      "xai": {
        "family": "xai"
      }
    }
  },
  "syntheticAuthRefs": [
    "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.baseUrl": {
      "label": "Grok Search Base URL",
      "help": "Optional xAI Responses API base URL for Grok web_search and x_search fallbacks."
    },
    "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.baseUrl": {
      "label": "X Search Base URL",
      "help": "Optional xAI Responses API base URL for x_search requests."
    },
    "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"
    ],
    "mediaUnderstandingProviders": [
      "xai"
    ],
    "speechProviders": [
      "xai"
    ],
    "realtimeTranscriptionProviders": [
      "xai"
    ],
    "imageGenerationProviders": [
      "xai"
    ],
    "tools": [
      "code_execution",
      "x_search"
    ]
  },
  "mediaUnderstandingProviderMetadata": {
    "xai": {
      "capabilities": [
        "audio"
      ],
      "defaultModels": {
        "audio": "grok-stt"
      },
      "autoPriority": {
        "audio": 25
      }
    }
  },
  "toolMetadata": {
    "code_execution": {
      "authSignals": [
        {
          "provider": "xai"
        }
      ],
      "configSignals": [
        {
          "rootPath": "plugins.entries.xai.config",
          "overlayPath": "webSearch",
          "required": [
            "apiKey"
          ]
        },
        {
          "rootPath": "tools.web.search.grok",
          "required": [
            "apiKey"
          ]
        }
      ]
    },
    "x_search": {
      "authSignals": [
        {
          "provider": "xai"
        }
      ],
      "configSignals": [
        {
          "rootPath": "plugins.entries.xai.config",
          "overlayPath": "webSearch",
          "required": [
            "apiKey"
          ]
        },
        {
          "rootPath": "tools.web.search.grok",
          "required": [
            "apiKey"
          ]
        }
      ]
    }
  },
  "configContracts": {
    "compatibilityRuntimePaths": [
      "tools.web.search.apiKey"
    ]
  },
  "configSchema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "webSearch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "apiKey": {
            "type": [
              "string",
              "object"
            ]
          },
          "model": {
            "type": "string"
          },
          "baseUrl": {
            "type": "string"
          },
          "inlineCitations": {
            "type": "boolean"
          }
        }
      },
      "xSearch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "model": {
            "type": "string"
          },
          "baseUrl": {
            "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"
          }
        }
      }
    }
  }
}
