Deploy 2Apifare
GeminiCLI into OpenAI,GEMINI API, supporting Antigravity models.
2apifare
Just deployed
Deploy and Host 2Apifare on Railway
2Apifare is an API gateway that converts Gemini CLI into OpenAI-compatible and Gemini-native APIs. It supports Antigravity models, multi-account management, automatic account rotation, and a built-in web control panel, allowing existing OpenAI applications to use Gemini and other supported models with minimal configuration.
About Hosting 2Apifare
Railway provides a simple way to deploy 2Apifare using the official Docker image. The service exposes an HTTP API and web-based control panel while Railway automatically manages HTTPS, networking, deployments, and environment variables. A Railway Volume mounted at /app/creds stores authentication credentials and session data, ensuring account information persists across redeployments and restarts. Once deployed, you can access the control panel to configure Gemini CLI accounts, monitor requests, and manage automatic account rotation.
Common Use Cases
- Convert Gemini CLI into OpenAI-compatible APIs for existing AI applications.
- Access Gemini native APIs through a unified gateway.
- Manage multiple Gemini accounts with automatic rotation and centralized monitoring.
Dependencies for 2Apifare Hosting
| Dependency | Required | Purpose |
|---|---|---|
| Railway Volume | Yes | Stores authentication credentials and session data. |
Deployment Dependencies
| Resource | Link |
|---|---|
| GitHub Repository | https://github.com/axibayuit-a11y/2apifare |
| Docker Image | https://github.com/axibayuit-a11y/2apifare/pkgs/container/2apifare |
Implementation Details
Docker
This template deploys the official Docker image:
ghcr.io/axibayuit-a11y/2apifare:latest
Railway pulls the prebuilt image directly, so no build commands are required.
Public Networking
| Setting | Value |
|---|---|
| Proxy Type | HTTP Proxy |
| Target Port | 7861 |
Environment Variables
Configure the following Railway Variables before deployment.
| Variable | Required | Description |
|---|---|---|
PASSWORD | Yes | Password used to access the web control panel and API. |
DOMAIN | Yes | Public Railway domain. Use ${{RAILWAY_PUBLIC_DOMAIN}}. |
HOST | Yes | Bind address. |
PORT | Yes | Internal application port. |
Raw Editor example:
PASSWORD=your_secure_password
DOMAIN=${{RAILWAY_PUBLIC_DOMAIN}}
HOST=0.0.0.0
PORT=7861
Persistent Storage
A Railway Volume is required.
- Open your Railway service.
- Navigate to Settings → Volumes.
- Click Add Volume.
- Mount the volume at:
/app/creds
The mounted volume stores authentication credentials, account information, and session data so they remain available after redeployments and restarts.
Database
No database is required.
Build & Start
This template deploys the official prebuilt Docker image.
No custom build or start commands are required.
Accessing the Application
After deployment:
- Open your Railway service.
- Navigate to Settings → Networking.
- Click Generate Domain.
- Open your generated Railway URL in a browser.
Initial Setup
When you first open the web interface:
- Sign in using the password configured in the
PASSWORDRailway variable. - Open the control panel.
- Configure your Gemini CLI account(s).
- Save the configuration.
- The gateway will begin serving OpenAI-compatible and Gemini-native API requests.
Features
- OpenAI-compatible API
- Gemini Native API
- Antigravity model support
- Multi-account management
- Automatic account rotation
- Real-time log monitoring
- Web-based management interface
Why Deploy 2Apifare on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying 2Apifare on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
