### Install Qwen Code with npm Source: https://docs.agentrouter.org/en/qwencode.html Use this command to globally install Qwen Code using npm. ```bash npm install -g @qwen-code/qwen-code ``` -------------------------------- ### Install Qwen Code with yarn Source: https://docs.agentrouter.org/en/qwencode.html Use this command to globally install Qwen Code using yarn. ```bash yarn global add @qwen-code/qwen-code ``` -------------------------------- ### Install Droid CLI for Windows Source: https://docs.agentrouter.org/en/droid.html Use this command to install the Droid CLI on Windows systems. ```powershell irm https://app.factory.ai/cli/windows | iex ``` -------------------------------- ### Install Qwen Code with pnpm Source: https://docs.agentrouter.org/en/qwencode.html Use this command to globally install Qwen Code using pnpm. ```bash pnpm install -g @qwen-code/qwen-code ``` -------------------------------- ### Install Droid CLI for macOS/Linux Source: https://docs.agentrouter.org/en/droid.html Use this command to install the Droid CLI on macOS or Linux systems. ```bash curl -fsSL https://app.factory.ai/cli | sh ``` -------------------------------- ### Install Codex CLI Source: https://docs.agentrouter.org/en/codex.html Install the Codex package globally using your preferred package manager. ```bash pnpm install -g @openai/codex ``` ```bash npm install -g @openai/codex ``` ```bash yarn global add @openai/codex ``` -------------------------------- ### Install Claude Code CLI Source: https://docs.agentrouter.org/en/start.html Global installation commands for the Claude Code package using common package managers. ```bash pnpm install -g @anthropic-ai/claude-code ``` ```bash npm install -g @anthropic-ai/claude-code ``` ```bash yarn global add @anthropic-ai/claude-code ``` -------------------------------- ### Add Environment Variables to Shell Configuration (Linux/macOS) Source: https://docs.agentrouter.org/en/qwencode.html Append these lines to your shell configuration file (e.g., ~/.bashrc or ~/.zshrc) for automatic environment variable setup on Linux/macOS. ```bash # Add to ~/.bashrc or ~/.zshrc file # Set your AgentRouter API key, available at https://agentrouter.org/console/token export OPENAI_API_KEY="sk-xxx" # Set AgentRouter's API base URL export OPENAI_BASE_URL="https://agentrouter.org/v1" # Optional export OPENAI_MODEL="gpt-5" # Optional, model name ``` -------------------------------- ### Add Environment Variables to Shell Configuration (Windows PowerShell) Source: https://docs.agentrouter.org/en/qwencode.html Add these lines to your PowerShell profile ($PROFILE) for automatic environment variable setup on Windows. ```powershell # Add to PowerShell profile ($PROFILE) # Set your AgentRouter API key, available at https://agentrouter.org/console/token $env:OPENAI_API_KEY="sk-xxx" # Set AgentRouter's API base URL $env:OPENAI_BASE_URL="https://agentrouter.org/v1" # Optional $env:OPENAI_MODEL="gpt-5" # Optional, model name ``` -------------------------------- ### Launch Qwen Code Directly Source: https://docs.agentrouter.org/en/qwencode.html Navigate to your project directory and run this command to launch Qwen Code after configuring environment variables. ```bash # Navigate to project directory cd my-project # Launch Qwen Code directly qwen ``` -------------------------------- ### Launch Claude Code Source: https://docs.agentrouter.org/en/start.html Navigate to the target project directory and initialize the Claude Code CLI. ```bash # Navigate to project directory cd my-project # Launch Claude Code directly claude ``` ```powershell # Navigate to project directory cd my-project # Launch Claude Code directly claude ``` ```cmd # Navigate to project directory cd my-project # Launch Claude Code directly claude ``` -------------------------------- ### Launch Codex CLI Source: https://docs.agentrouter.org/en/codex.html Navigate to the project directory and execute the codex command. ```bash # Navigate to project directory cd my-project # Launch OpenAI Codex directly codex ``` -------------------------------- ### Configure Environment Variables Source: https://docs.agentrouter.org/en/start.html Set the required API base URL and authentication tokens for Agent Router. ```bash # Set AgentRouter's API base URL export ANTHROPIC_BASE_URL=https://agentrouter.org/ # Set your AgentRouter API key, available at https://agentrouter.org/console/token export ANTHROPIC_AUTH_TOKEN=sk-xxx export ANTHROPIC_API_KEY=sk-xxx ``` ```powershell # Set AgentRouter's API base URL $env:ANTHROPIC_BASE_URL="https://agentrouter.org/" # Set your AgentRouter API key, available at https://agentrouter.org/console/token $env:ANTHROPIC_AUTH_TOKEN="sk-xxx" $env:ANTHROPIC_API_KEY="sk-xxx" ``` ```cmd # Set AgentRouter's API base URL set ANTHROPIC_BASE_URL=https://agentrouter.org/ # Set your AgentRouter API key, available at https://agentrouter.org/console/token set ANTHROPIC_AUTH_TOKEN=sk-xxx set ANTHROPIC_API_KEY=sk-xxx ``` -------------------------------- ### Configure VSCode Extension Source: https://docs.agentrouter.org/en/codex.html Add the API base URL and configuration settings to the VSCode settings JSON. ```json "chatgpt.apiBase": "https://agentrouter.org/v1", "chatgpt.config": { "pepreferred_auth_method": "api_key", "model_provider": "openai-chat-completions" } ``` -------------------------------- ### Configure Environment Variables (Windows CMD) Source: https://docs.agentrouter.org/en/qwencode.html Set environment variables for AgentRouter's OpenAI API on Windows using Command Prompt. Replace 'sk-xxx' with your AgentRouter API key. ```bash # Set your AgentRouter API key, available at https://agentrouter.org/console/token set OPENAI_API_KEY="sk-xxx" # Set AgentRouter's API base URL set OPENAI_BASE_URL="https://agentrouter.org/v1" # Optional set OPENAI_MODEL="gpt-5" # Optional, model name ``` -------------------------------- ### Configure Codex Environment Source: https://docs.agentrouter.org/en/codex.html Define the model and provider settings in the config.toml file. ```toml model = "gpt-5" model_provider = "openai-chat-completions" preferred_auth_method = "apikey" [model_providers.openai-chat-completions] name = "OpenAI using Chat Completions" base_url = "https://agentrouter.org/v1" env_key = "AGENT_ROUTER_TOKEN" wire_api = "chat" query_params = {} stream_idle_timeout_ms = 300000 ``` -------------------------------- ### Configure Environment Variables (Linux/macOS) Source: https://docs.agentrouter.org/en/qwencode.html Set environment variables for AgentRouter's OpenAI API on Linux or macOS. Ensure you replace 'sk-xxx' with your actual AgentRouter API key. ```bash # Set your AgentRouter API key, available at https://agentrouter.org/console/token export OPENAI_API_KEY="sk-xxx" # Set AgentRouter's API base URL export OPENAI_BASE_URL="https://agentrouter.org/v1" # Optional export OPENAI_MODEL="gpt-5" # Optional, model name ``` -------------------------------- ### Configure Model Selection Source: https://docs.agentrouter.org/en/start.html Set environment variables to specify the primary and fast-path models used by Claude Code. ```bash # Primary model export ANTHROPIC_MODEL=claude-sonnet-4-5-20250929 # Fast model for lightweight ops (deprecated; use only if needed) export ANTHROPIC_SMALL_FAST_MODEL=claude-3-5-haiku-20241022 # Launch Claude Code claude ``` ```powershell # Primary model $env:ANTHROPIC_MODEL = "claude-sonnet-4-5-20250929" # Fast model for lightweight ops (deprecated; use only if needed) $env:ANTHROPIC_SMALL_FAST_MODEL = "claude-3-5-haiku-20241022" # Launch Claude Code claude ``` ```bash # Primary model set ANTHROPIC_MODEL=claude-sonnet-4-5-20250929 # Fast model for lightweight ops (deprecated; use only if needed) set ANTHROPIC_SMALL_FAST_MODEL=claude-3-5-haiku-20241022 # Launch Claude Code claude ``` -------------------------------- ### Configure Environment Variables (Windows PowerShell) Source: https://docs.agentrouter.org/en/qwencode.html Set environment variables for AgentRouter's OpenAI API on Windows using PowerShell. Replace 'sk-xxx' with your AgentRouter API key. ```powershell # Set your AgentRouter API key, available at https://agentrouter.org/console/token $env:OPENAI_API_KEY="sk-xxx" # Set AgentRouter's API base URL $env:OPENAI_BASE_URL="https://agentrouter.org/v1" # Optional $env:OPENAI_MODEL="gpt-5" # Optional, model name ``` -------------------------------- ### Set Authentication Key Source: https://docs.agentrouter.org/en/codex.html Store the API key in the auth.json file. ```json { "OPENAI_API_KEY":"Replace this with your API KEY" } ``` -------------------------------- ### Configure Agent Router Model in Droid CLI Source: https://docs.agentrouter.org/en/droid.html Edit the `~/.factory/config.json` file to add Agent Router as a custom model. Replace YOUR_AGENT_ROUTER_KEY with your actual key. ```json { "custom_models": [ { "model_display_name": "agentrouter-gpt5", "model": "gpt-5", "base_url": "https://agentrouter.org/v1", "api_key": "YOUR_AGENT_ROUTER_KEY", "provider": "generic-chat-completion-api", "max_tokens": 1280000 } ] } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.