An OpenAI API 500 Internal Server Error is OpenAI-side, not your code. Check for incidents, retry 500/502/503 with backoff, and add a circuit breaker.