---
title: "Deploy 2Apifare"
description: "GeminiCLI into OpenAI,GEMINI API, supporting Antigravity models."
category: "AI/ML"
url: https://railway.com/deploy/2apifare
---

# Deploy 2Apifare

GeminiCLI into OpenAI,GEMINI API, supporting Antigravity models.

**[Deploy 2Apifare on Railway](https://railway.com/template/2apifare)**

- **Creator:** Muhammad Bilal
- **Category:** AI/ML

## Template content

### 2apifare

- **Image:** ghcr.io/axibayuit-a11y/2apifare:latest
- **Public domain:** Yes

## Documentation

# 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:

```text
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:

```env
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:

```text
/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.

## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/2apifare
