If you're experiencing the "ETIMEDOUT" error while trying to connect to the OpenAI API (https://api.openai.com/v1/chat/completions), changing your DNS settings to Cloudflare or Google Public DNS might help resolve the issue. This simple guide will walk you through the process of changing your DNS settings on macOS.

  1. Click on the Apple menu in the top-left corner of your screen and select "System Preferences."
  2. Click on "Network."
  3. Select your active network connection (e.g., Ethernet or Wi-Fi) from the list on the left.
  4. Click the "Advanced" button in the lower right corner.
  5. Go to the "DNS" tab.
  6. To add a new DNS server, click the "+" button at the bottom left of the DNS Servers list.
  7. Enter the DNS server addresses for Cloudflare DNS or Google Public DNS:
  8. To remove any existing DNS server addresses, select the address and click the "-" button.
  9. Click "OK" to save your changes.
  10. Click "Apply" in the Network settings window to apply the new DNS settings.