"""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 = "grok-beta"

    # 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
