antigravity2api-nodejs  by liuw1535

Node.js proxy service for Google Antigravity API

Created 1 month ago
544 stars

Top 58.5% on SourcePulse

GitHubView on GitHub
Project Summary

This project offers a Node.js proxy service that translates requests for Google's Antigravity API into an OpenAI-compatible format. It targets developers seeking to integrate Google's AI models (like Gemini) using the familiar OpenAI API structure, providing benefits such as simplified integration, advanced feature support, and streamlined multi-account management.

How It Works

The service acts as an intermediary, converting incoming requests into a format understandable by Google's AI services and translating the responses back to OpenAI's specification. Key architectural decisions include robust support for streaming and non-streaming responses, enabling sophisticated tool/function calling, and implementing automatic rotation and refresh mechanisms for multiple Google API accounts. This approach abstracts the complexities of direct Google API interaction, offering a unified and reliable interface.

Quick Start & Requirements

Requires Node.js version 18.0.0 or higher. Installation is performed via npm install. Configuration is managed through an .env file, necessitating API_KEY, ADMIN_USERNAME, ADMIN_PASSWORD, and JWT_SECRET. Initial setup involves running npm run login to authorize Google access and obtain authentication tokens, stored in data/accounts.json. The service starts with npm start, accessible at http://localhost:8045, which also hosts a web management interface.

Highlighted Details

  • Full OpenAI API compatibility for Google AI models.
  • Support for streaming/non-streaming responses and tool/function calling.
  • Automatic multi-account rotation and token refresh for high availability.
  • Web-based management interface for configuration, token monitoring, and statistics.
  • Handles Base64 encoded image inputs and supports image generation via specific models.
  • Optional random ProjectId generation for Pro accounts.

Maintenance & Community

No specific details regarding maintainers, community channels (e.g., Discord, Slack), or project roadmap were provided in the README.

Licensing & Compatibility

The project is released under the MIT License, which is permissive for commercial use and integration into closed-source projects. However, users must adhere to the terms of service of the underlying Google AI APIs.

Limitations & Caveats

The random ProjectId generation feature is explicitly restricted to Pro subscription accounts; its use by free accounts is noted as exploiting a bug. Certain server configurations, such as port and host changes, necessitate a service restart. The README does not provide specific performance benchmarks or detailed comparisons against other proxy solutions.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
35
Issues (30d)
58
Star History
269 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.