### Start Codex project Source: https://modelflare.dev/docs/codex Commands to initialize a project directory and start the Codex CLI. ```powershell Set-Location $HOME New-Item -ItemType Directory -Force "my-codex-project" | Out-Null Set-Location "my-codex-project" codex --model gpt-5.6-sol ``` ```bash cd ~ mkdir -p my-codex-project cd my-codex-project codex --model gpt-5.6-sol ``` -------------------------------- ### Install Gemini CLI Source: https://modelflare.dev/docs/gemini-cli Install the latest version of the Gemini CLI globally via npm and verify the installation. ```bash npm install -g @google/gemini-cli@latest gemini --version ``` -------------------------------- ### Start OpenCode Source: https://modelflare.dev/docs/opencode Initializes the OpenCode interface within the project directory. ```bash opencode ``` -------------------------------- ### Start and Test Connection Source: https://modelflare.dev/docs/grok-build Verify the configuration by running a test prompt through the Grok CLI. ```powershell Set-Location $HOME grok -p "Reply only: Modelflare connected" -m modelflare-grok grok ``` ```bash cd ~ grok -p "Reply only: Modelflare connected" -m modelflare-grok grok ``` -------------------------------- ### Install OpenCode CLI Source: https://modelflare.dev/docs/opencode Commands to install the OpenCode CLI on different operating systems. ```powershell choco install opencode opencode --version ``` ```bash curl -fsSL https://opencode.ai/install | bash opencode --version ``` -------------------------------- ### Install Grok Build CLI Source: https://modelflare.dev/docs/grok-build Commands to download and install the Grok CLI on different operating systems. ```powershell irm https://x.ai/cli/install.ps1 | iex grok version ``` ```bash curl -fsSL https://x.ai/cli/install.sh | bash grok version ``` -------------------------------- ### Start and Test Gemini CLI Source: https://modelflare.dev/docs/gemini-cli Initialize the CLI with a specific model ID and send a test message to verify connectivity. ```bash gemini --model YOUR_MODEL_ID ``` ```text Reply with one sentence confirming the connection is working. ``` -------------------------------- ### Install Codex CLI manually Source: https://modelflare.dev/docs/codex Commands to download and verify the Codex CLI installation. ```powershell irm https://chatgpt.com/codex/install.ps1 | iex codex --version ``` ```bash curl -fsSL https://chatgpt.com/codex/install.sh | sh codex --version ``` -------------------------------- ### Start and test Claude Code Source: https://modelflare.dev/docs/claude-code Commands to launch the CLI and verify the connection. ```bash claude ``` ```text Reply with one sentence confirming the active model. ``` -------------------------------- ### Install Claude Code CLI Source: https://modelflare.dev/docs/claude-code Commands to install the Claude Code CLI tool on different operating systems. ```powershell irm https://claude.ai/install.ps1 | iex claude --version ``` ```bash curl -fsSL https://claude.ai/install.sh | bash claude --version ``` -------------------------------- ### Install Codex via automated script Source: https://modelflare.dev/docs/codex Use these commands to automatically install or update Codex on your system. ```bash curl -fsSL https://modelflare.dev/install/codex.sh | sh ``` ```bash curl -fsSL https://modelflare.dev/install/codex.sh | MODELFLARE_ALLOW_ROOT=1 sh ``` ```powershell irm https://modelflare.dev/install/codex.ps1 | iex ``` -------------------------------- ### Verify Codex CLI connection Source: https://modelflare.dev/docs/codex Run this command in a new terminal session to verify the installation and active model. ```bash codex --model gpt-5.6-sol ``` -------------------------------- ### Create config.toml Source: https://modelflare.dev/docs/codex Commands to generate the configuration file with provider settings. ```powershell $config = @' model_provider = "modelflare" model = "gpt-5.6-sol" model_reasoning_effort = "xhigh" disable_response_storage = true model_supports_reasoning_summaries = true [model_providers.modelflare] name = "Modelflare" base_url = "https://modelflare.dev/v1" wire_api = "responses" [model_providers.modelflare.auth] command = "powershell.exe" args = ["-NoProfile", "-NonInteractive", "-Command", "Get-Content -LiteralPath (Join-Path (Join-Path $HOME '.codex') 'modelflare_api_key') -Raw"] '@ $utf8NoBom = New-Object System.Text.UTF8Encoding -ArgumentList $false [System.IO.File]::WriteAllText( (Join-Path (Get-Location) "config.toml"), $config, $utf8NoBom ) ``` ```bash cat > config.toml << 'EOF' model_provider = "modelflare" model = "gpt-5.6-sol" model_reasoning_effort = "xhigh" disable_response_storage = true model_supports_reasoning_summaries = true [model_providers.modelflare] name = "Modelflare" base_url = "https://modelflare.dev/v1" wire_api = "responses" [model_providers.modelflare.auth] command = "sh" args = ["-lc", "cat ~/.codex/modelflare_api_key"] EOF chmod 600 config.toml ``` -------------------------------- ### Create config.toml Source: https://modelflare.dev/docs/grok-build Create the configuration file required to define the Modelflare model backend. ```powershell New-Item -ItemType Directory -Force "$HOME\.grok" | Out-Null Set-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 ) ``` ```bash mkdir -p ~/.grok cd ~/.grok cat > 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" EOF chmod 600 config.toml ``` -------------------------------- ### Create modelflare_api_key file Source: https://modelflare.dev/docs/codex Commands to save your API key securely in the configuration directory. ```powershell $apiKey = @' YOUR_MODELFLARE_API_KEY '@ $apiKey = $apiKey.Trim() $utf8NoBom = New-Object System.Text.UTF8Encoding -ArgumentList $false [System.IO.File]::WriteAllText( (Join-Path (Get-Location) "modelflare_api_key"), $apiKey, $utf8NoBom ) $apiKey = $null ``` ```bash cat > modelflare_api_key << 'EOF' YOUR_MODELFLARE_API_KEY EOF chmod 600 modelflare_api_key ``` -------------------------------- ### Create .codex directory Source: https://modelflare.dev/docs/codex Commands to initialize the required configuration directory. ```powershell New-Item -ItemType Directory -Force "$HOME\.codex" | Out-Null Set-Location "$HOME\.codex" ``` ```bash mkdir -p ~/.codex cd ~/.codex ``` -------------------------------- ### Test Model Connection Source: https://modelflare.dev/docs/opencode A sample prompt to verify that the model is correctly configured and responding. ```text Reply with one short greeting. ``` -------------------------------- ### Create Claude Code settings file Source: https://modelflare.dev/docs/claude-code Commands to create the configuration file with Modelflare API credentials and model aliases. ```powershell New-Item -ItemType Directory -Force "$HOME\.claude" | Out-Null Set-Location "$HOME\.claude" $settings = @' { "env": { "ANTHROPIC_BASE_URL": "https://modelflare.dev", "ANTHROPIC_AUTH_TOKEN": "YOUR_MODELFLARE_API_KEY", "ANTHROPIC_MODEL": "claude-opus-4-8", "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-8", "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-sonnet-5" } } '@ $utf8NoBom = New-Object System.Text.UTF8Encoding -ArgumentList $false [System.IO.File]::WriteAllText( (Join-Path (Get-Location) "settings.json"), $settings, $utf8NoBom ) ``` ```bash mkdir -p ~/.claude cd ~/.claude cat > settings.json << 'EOF' { "env": { "ANTHROPIC_BASE_URL": "https://modelflare.dev", "ANTHROPIC_AUTH_TOKEN": "YOUR_MODELFLARE_API_KEY", "ANTHROPIC_MODEL": "claude-opus-4-8", "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-8", "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-sonnet-5" } } EOF chmod 600 settings.json ``` -------------------------------- ### Create opencode.json Configuration Source: https://modelflare.dev/docs/opencode Generates the required configuration file for Modelflare integration in the project directory. ```powershell $config = @' { "$schema": "https://opencode.ai/config.json", "model": "modelflare/deepseek-v4-pro", "provider": { "modelflare": { "npm": "@ai-sdk/openai-compatible", "name": "Modelflare", "options": { "baseURL": "https://modelflare.dev/v1" }, "models": { "deepseek-v4-pro": { "name": "DeepSeek V4 Pro" } } } } } '@ $utf8NoBom = New-Object System.Text.UTF8Encoding -ArgumentList $false [System.IO.File]::WriteAllText( (Join-Path (Get-Location) "opencode.json"), $config, $utf8NoBom ) ``` ```bash cat > opencode.json << 'EOF' { "$schema": "https://opencode.ai/config.json", "model": "modelflare/deepseek-v4-pro", "provider": { "modelflare": { "npm": "@ai-sdk/openai-compatible", "name": "Modelflare", "options": { "baseURL": "https://modelflare.dev/v1" }, "models": { "deepseek-v4-pro": { "name": "DeepSeek V4 Pro" } } } } } EOF ``` -------------------------------- ### Test Codex model response Source: https://modelflare.dev/docs/codex Use this prompt to confirm that the model and provider are correctly configured. ```text Reply with one sentence confirming the active model and provider. ``` -------------------------------- ### Configure Modelflare Environment Variables Source: https://modelflare.dev/docs/gemini-cli Set the required environment variables to point the Gemini CLI to the Modelflare API endpoint. ```powershell $env:GEMINI_API_KEY="YOUR_MODELFLARE_API_KEY" $env:GOOGLE_GEMINI_BASE_URL="https://modelflare.dev" ``` ```bash export GEMINI_API_KEY="YOUR_MODELFLARE_API_KEY" export GOOGLE_GEMINI_BASE_URL="https://modelflare.dev" ``` -------------------------------- ### Troubleshooting CLI commands Source: https://modelflare.dev/docs/codex Commands used to resolve common errors or environment issues. ```bash codex.cmd ``` -------------------------------- ### Save API Key Source: https://modelflare.dev/docs/grok-build Set the Modelflare API key as an environment variable for the current session and future terminal instances. ```powershell [Environment]::SetEnvironmentVariable( "MODELFLARE_API_KEY", "YOUR_MODELFLARE_API_KEY", "User" ) $env:MODELFLARE_API_KEY = "YOUR_MODELFLARE_API_KEY" ``` ```bash echo 'export MODELFLARE_API_KEY="YOUR_MODELFLARE_API_KEY"' >> ~/.bashrc source ~/.bashrc ``` ```bash echo 'export MODELFLARE_API_KEY="YOUR_MODELFLARE_API_KEY"' >> ~/.zshrc source ~/.zshrc ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.