Prepare a local environment
Choose a terminal and verify Node.js, Python, curl, and environment variables.
Choose a terminal
Commands marked bash run in Bash; Windows users can use WSL or Git Bash. Commands marked powershell run in PowerShell. Do not mix Bash backslash continuation with PowerShell syntax.
In some Windows environments, curl is an alias. Use curl.exe for the executable or follow the curl guide using Invoke-RestMethod.
Check dependencies
For Node.js SDKs or npm-based clients, select a supported LTS release from Node.js. For Python examples, use a version supported by the dependency and preferably a project-specific virtual environment.
node --version
npm --version
python --versionCheck only the runtime you need. If a command is missing, complete its official installation and reopen the terminal to verify PATH. Running curl does not require installing every SDK.
Set session variables
Bash:
export IROUTER_API_KEY='<your-irouter-api-key>'
export IROUTER_MODEL='<model-id>'
export IROUTER_API_BASE='https://gateway.irouter.io/v1'PowerShell:
$env:IROUTER_API_KEY = '<your-irouter-api-key>'
$env:IROUTER_MODEL = '<model-id>'
$env:IROUTER_API_BASE = 'https://gateway.irouter.io/v1'Replace both placeholders and launch your application from that terminal. These commands affect the current process and future child processes, not already-running IDEs or background services.
Troubleshoot the environment
For missing commands, inspect installation paths. For ignored settings, inspect the launching terminal. Save scripts and request files as UTF-8 when handling non-ASCII text. Do not disable TLS verification to address connection errors. Continue with the OpenAI SDK or the relevant client guide.