Stability Enhancement Program
The following measures are recommended for enterprise private deployment scenarios:
- process guard: Run with tools such as PM2
openai-api-server.js
If you want to configure an automatic reboot policy - OAuth auto-renewal: Ensure that the deployment environment is accessible
accounts.google.com
The system automatically renews the token 72 hours before it expires. - network optimization: Add Google API domain (*.googleapis.com) and port 443 to the firewall whitelist
- Load Monitoring: By
--port
Parameter switching non-standard ports (e.g. 8080) with Nginx for load balancing
Critical Troubleshooting: 1) Checking when API key failsGOOGLE_API_KEY
Environment variable 2) Enable on streaming interruptConnection: keep-alive
Header 3) Logging ErrorsECONNRESET
The MTU value needs to be adjusted.
This answer comes from the articleGemini-CLI-2-API: Converting the Gemini CLI to an OpenAI-compatible Native API ServiceThe