The following steps are required to install and configure Gemini-CLI-2-API:
- environmental preparation: First you need to install Node.js (the latest LTS version is recommended). You can verify if the installation was successful by using the node -v and npm -v commands.
- Get Code: Use Git to clone your project repository locally:
 git clone https://github.com/justlovemaki/Gemini-CLI-2-API.git
 cd Gemini-CLI-2-API
- Installation of dependencies: Run the npm install command in the project directory to install all dependencies.
- Configuring Authentication: Two options are available:
- OAuth authentication: the first time you run the program will automatically guide you to sign in to your Google account in your browser
- API key: set GOOGLE_API_KEY and GOOGLE_GENAI_USE_VERTEXAI environment variables
 
- Starting services: Started with the command node openai-api-server.js, with customizable ports and keys via the -port and -api-key arguments.
The entire installation process requires attention to a stable network connection, especially OAuth authentication needs to have access to Google servers.
This answer comes from the articleGemini-CLI-2-API: Converting the Gemini CLI to an OpenAI-compatible Native API ServiceThe































 English
English				 简体中文
简体中文					           日本語
日本語					           Deutsch
Deutsch					           Português do Brasil
Português do Brasil