Special care needs to be taken when using this tool:
- Authentication security::
GEMINI_AUTH_PASSWORDMust be set to a non-null value, otherwise all API requests will return a 401 error - quota monitoring::
The Google Cloud free tier has a limit of 60 calls per minute, and it is recommended to pass thegcloud quota metricsMonitor usage - Streaming Response::
Clients need to implement chunked data reception logic, ordinary HTTP libraries may not be able to directly handle SSE format response - OAuth Time Limit::
The default validity of refresh_token is 7 days, long running services need to implement an auto-renewal mechanism
Recommended Practices for Production Environments:
- Managing the Service Lifecycle with Docker Compose
- Adding HTTPS and Rate Limiting via Nginx
- Periodic rotation of API access passwords
This answer comes from the articlegeminicli2api: Proxy tool to convert Gemini CLI to OpenAI-compatible APIsThe































