15% off all models 🎉 Every model at 85% of OpenRouter list price.Browse models →

Prepare your terminal and development environment

Set up a terminal, Node.js, and your ApiFlux API key before installing command-line AI tools.

This guide is for anyone using command-line tools for the first time. You will learn how to open a terminal, install the required tools, set an API key, and use the correct commands for your operating system.

If you only need to create a key in the ApiFlux console, go directly to Create an ApiFlux API key. Read this page first if you plan to use Codex CLI, Claude Code, or OpenCode.

Three concepts to know first

1. What is the terminal?

The terminal is where you enter commands. Codex CLI, Claude Code, and OpenCode are command-line tools, so you launch and use them from a terminal.

Operating SystemRecommended
WindowsPowerShell or Windows Terminal
macOSTerminal
LinuxYour distribution's Terminal app

Windows users can click the Start menu and search for PowerShell. macOS users can press Command + Space and search for Terminal. Linux users can usually open Terminal from the application menu.

Run this command:

pwd

If it prints your current directory, the terminal is working.

2. What is an API key?

An API key is the credential a tool uses to access ApiFlux. Treat it like a password for API requests.

The guides use this placeholder wherever you need to enter your key:

YOUR_APIFLUX_API_KEY

Replace it with the key you created in the ApiFlux console.

[!WARNING] Never expose a real API key in public chats, forums, GitHub repositories, videos, or unredacted screenshots.

3. What is Base URL?

The Base URL is the address where the tool sends requests. The OpenAI-compatible Base URL for ApiFlux is:

https://apiflux.ai/v1

The website is:

https://apiflux.ai/

Use the website to sign in and manage your account. Use the Base URL when configuring tools and SDKs.

Windows preparation steps

1. Open PowerShell

Click on the Start menu and search for:

PowerShell

After opening, you can enter commands.

2. Install Node.js LTS

Common installation methods of Codex CLI and OpenCode use npm. npm is installed with Node.js.

Open the Node.js website:

https://nodejs.org/

Download and install the LTS version. After the installation is complete, close PowerShell and reopen it.

Verify the installation:

node -v
npm -v

If both commands print version numbers, Node.js and npm are ready.

3. Set the ApiFlux API key

For your first test, set the environment variable in the current PowerShell session:

$env:APIFLUX_API_KEY="YOUR_APIFLUX_API_KEY"

Verify the variable:

echo $env:APIFLUX_API_KEY

To make the variable available in future PowerShell sessions, save it as a user environment variable:

[Environment]::SetEnvironmentVariable("APIFLUX_API_KEY","YOUR_APIFLUX_API_KEY","User")

Close and reopen PowerShell after saving the variable.

macOS preparation steps

1. Open the terminal

Press Command + Space and search for:

Terminal

2. Install Node.js LTS

Open the Node.js website:

https://nodejs.org/

Download and install the LTS version. After the installation is complete, close the terminal and reopen it.

Verify the installation:

node -v
npm -v

3. Set the ApiFlux API key

For the current terminal session:

export APIFLUX_API_KEY="YOUR_APIFLUX_API_KEY"

Verify the variable:

echo $APIFLUX_API_KEY

To persist the variable, add it to ~/.zshrc:

echo 'export APIFLUX_API_KEY="YOUR_APIFLUX_API_KEY"' >> ~/.zshrc
source ~/.zshrc

Linux preparation steps

1. Open the terminal

Open Terminal from the application menu.

2. Install common basic tools

Ubuntu/Debian users can run:

sudo apt update
sudo apt install -y curl git

Fedora users can run:

sudo dnf install -y curl git

3. Install Node.js LTS

Open the Node.js website:

https://nodejs.org/

Follow the Linux installation instructions to install the LTS version.

Verify after installation is complete:

node -v
npm -v

4. Set the ApiFlux API key

For the current terminal session:

export APIFLUX_API_KEY="YOUR_APIFLUX_API_KEY"

Check:

echo $APIFLUX_API_KEY

To persist the variable, add it to ~/.bashrc:

echo 'export APIFLUX_API_KEY="YOUR_APIFLUX_API_KEY"' >> ~/.bashrc
source ~/.bashrc

If you use zsh, add it to ~/.zshrc instead.

Does Windows require WSL?

No. Windows PowerShell is sufficient for the steps in these guides.

Consider WSL if you frequently use Git, Node.js, Linux commands, or other development tools. When working inside WSL, follow the Linux instructions.