Railway

Deploy 2Apifare

GeminiCLI into OpenAI,GEMINI API, supporting Antigravity models.

Deploy 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

DependencyRequiredPurpose
Railway VolumeYesStores authentication credentials and session data.

Deployment Dependencies

ResourceLink
GitHub Repositoryhttps://github.com/axibayuit-a11y/2apifare
Docker Imagehttps://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

SettingValue
Proxy TypeHTTP Proxy
Target Port7861

Environment Variables

Configure the following Railway Variables before deployment.

VariableRequiredDescription
PASSWORDYesPassword used to access the web control panel and API.
DOMAINYesPublic Railway domain. Use ${{RAILWAY_PUBLIC_DOMAIN}}.
HOSTYesBind address.
PORTYesInternal 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.

  1. Open your Railway service.
  2. Navigate to Settings → Volumes.
  3. Click Add Volume.
  4. 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:

  1. Open your Railway service.
  2. Navigate to Settings → Networking.
  3. Click Generate Domain.
  4. Open your generated Railway URL in a browser.

Initial Setup

When you first open the web interface:

  1. Sign in using the password configured in the PASSWORD Railway variable.
  2. Open the control panel.
  3. Configure your Gemini CLI account(s).
  4. Save the configuration.
  5. 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

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
113
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

Jan Kubica
1
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

codestorm
56