Assistentes de programação
Configuração do Grok Build
Configure a CLI oficial do Grok Build com o endpoint da API Responses.
1. Crie uma chave API
Seção intitulada “1. Crie uma chave API”Crie uma chave de API Modelflare que possa acessar grok-4.5.
2. Instale o Grok Build
Seção intitulada “2. Instale o Grok Build”irm https://x.ai/cli/install.ps1 | iexgrok versioncurl -fsSL https://x.ai/cli/install.sh | bashgrok version3. Criar config.toml
Seção intitulada “3. Criar config.toml”New-Item -ItemType Directory -Force "$HOME\.grok" | Out-NullSet-Location "$HOME\.grok"$config = @'[models]default = "modelflare-grok"
[model.modelflare-grok]model = "grok-4.5"base_url = "https://modelflare.dev/v1"name = "Modelflare Grok 4.5"env_key = "MODELFLARE_API_KEY"api_backend = "responses"'@$utf8NoBom = New-Object System.Text.UTF8Encoding -ArgumentList $false[System.IO.File]::WriteAllText( (Join-Path (Get-Location) "config.toml"), $config, $utf8NoBom)mkdir -p ~/.grokcd ~/.grokcat > config.toml << 'EOF'[models]default = "modelflare-grok"
[model.modelflare-grok]model = "grok-4.5"base_url = "https://modelflare.dev/v1"name = "Modelflare Grok 4.5"env_key = "MODELFLARE_API_KEY"api_backend = "responses"EOFchmod 600 config.toml4. Salve sua chave API
Seção intitulada “4. Salve sua chave API”Substitua YOUR_MODELFLARE_API_KEY pela sua chave API Modelflare completa.
[Environment]::SetEnvironmentVariable( "MODELFLARE_API_KEY", "YOUR_MODELFLARE_API_KEY", "User")$env:MODELFLARE_API_KEY = "YOUR_MODELFLARE_API_KEY"echo 'export MODELFLARE_API_KEY="YOUR_MODELFLARE_API_KEY"' >> ~/.bashrcsource ~/.bashrcecho 'export MODELFLARE_API_KEY="YOUR_MODELFLARE_API_KEY"' >> ~/.zshrcsource ~/.zshrc5. Iniciar e testar
Seção intitulada “5. Iniciar e testar”Set-Location $HOMEgrok -p "Reply only: Modelflare connected" -m modelflare-grokgrokcd ~grok -p "Reply only: Modelflare connected" -m modelflare-grokgrok