When using OpenAI-compatible providers/proxies, treat authentication and endpoint routing as separate concerns:

Example (proxy via OpenAI-compatible settings):

# Proxy root only (no trailing path)
export OPENAI_HOST="https://your-proxy.example.com"

# Path the proxy serves (ensure it matches, e.g., v1/chat/completions)
export OPENAI_BASE_PATH="/v1/chat/completions"

# Auth token used by the client
export OPENAI_API_KEY="$YOUR_KEY"

Practical troubleshooting: