"""xAI Grok LLM provider for Local Deep Research."""

from ..openai_base import OpenAICompatibleProvider


class XAIProvider(OpenAICompatibleProvider):
    """xAI Grok provider using OpenAI-compatible endpoint.

    This uses xAI's OpenAI-compatible API endpoint to access Grok models.
    """

    provider_name = "xAI Grok"
    api_key_setting = "llm.xai.api_key"
    default_base_url = "https://api.x.ai/v1"
    default_model = ""  # User must explicitly pick a model — no silent fallback

    # Metadata for auto-discovery
    provider_key = "XAI"
    company_name = "xAI"
    is_cloud = True

    @classmethod
    def requires_auth_for_models(cls):
        """xAI requires authentication for listing models."""
        return True
