Linux Configuration

0.35x Price - Programming tool APIs at 0.35x of the original price!

This guide will help you configure Codex CLI with Fizzly API on Linux.

Prerequisites

  • Linux (Ubuntu, Debian, Fedora, Arch, etc.)
  • Node.js 18+ installed
  • Fizzly API key (Get one here)

Install Codex CLI

Check Node.js Version

Open a terminal and verify Node.js is installed:

node --version

You should see output like v18.x.x or higher. If not, install Node.js using your package manager.

# Ubuntu/Debian
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
 
# Fedora
sudo dnf install nodejs
 
# Arch Linux
sudo pacman -S nodejs npm

Install Codex CLI

Install Codex globally using npm:

npm install -g @openai/codex

Verify the installation:

codex --version

Configure API

Add to your ~/.bashrc:

# Open .bashrc
nano ~/.bashrc
 
# Add these lines at the end:
export OPENAI_API_KEY="your-fizzly-api-key"
export OPENAI_BASE_URL="https://api.fizzlyapi.com/v1"

Apply changes:

source ~/.bashrc

Verify Configuration

Run the following commands to verify your setup:

# Check environment variables are set
echo $OPENAI_API_KEY
echo $OPENAI_BASE_URL
 
# Start Codex
codex

If you see the Codex interactive prompt, congratulations! Your setup is complete.

Expected output:

╭──────────────────────────────────────────────────╮
│ Codex CLI                                        │
│ Welcome! Type your request or use /help          │
╰──────────────────────────────────────────────────╯
>

Supported Models

Supports 200+ AI models. See Codex CLI Models.

Basic Usage

# Start interactive mode
codex
 
# Run a single command
codex "Write a Python quicksort function"
 
# Use a specific model
codex --model gpt-4o
 
# Show help
codex --help

Troubleshooting

1. “codex” Command Not Found

Cause: Codex CLI is not installed or not in PATH.

Solution:

# Reinstall Codex
npm install -g @openai/codex
 
# Check npm global bin path
npm config get prefix
 
# Add to PATH if needed (add to ~/.bashrc)
export PATH="$(npm config get prefix)/bin:$PATH"

2. “OPENAI_API_KEY not set” Error

Cause: Environment variables are not configured correctly.

Solution:

# Verify variables are set
printenv | grep OPENAI
 
# If empty, check shell config
cat ~/.bashrc | grep OPENAI
 
# Re-source the config
source ~/.bashrc

3. Permission Denied

Cause: Insufficient permissions for executing Codex or npm install.

Solution:

# Fix npm permissions
mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
 
# Reinstall Codex
npm install -g @openai/codex

4. Connection Timeout

Cause: Network issues or firewall blocking.

Solution:

  1. Check your internet connection
  2. Verify the API URL is correct: https://api.fizzlyapi.com/v1
  3. Check if firewall is blocking the connection
  4. If using a proxy, configure your proxy settings

5. Authentication Failed (401)

Cause: Invalid or expired API key.

Solution:

  1. Verify your API key is correct in the Fizzly Console
  2. Ensure the key has not been deleted or disabled
  3. Copy and paste the key again (watch for extra spaces)

6. SSL Certificate Error

Cause: Outdated CA certificates or proxy interference.

Solution:

# Update CA certificates
# Ubuntu/Debian
sudo apt update && sudo apt install ca-certificates
 
# Fedora
sudo dnf install ca-certificates
 
# Arch Linux
sudo pacman -S ca-certificates

Need more help? Check the FAQ page.

Next Steps