AI Personal Learning
and practical guidance
豆包Marscode1

Grok-Mirror: one-click deployment of a profitable Grok mirror site

General Introduction

Grok-Mirror is a program based on the Serverless rapid deployment Grok3 domestic mirror site The Grok Mirror Station built to be operable. It allows users to deploy a local Grok kiosk with one click via Docker. grok is an AI assistant launched by xAI, and Grok-Mirror allows users to use Grok's features without visiting xAI's official website through mirroring technology. The project supports multi-user management and provides an API interface compatible with the OpenAI format. It has a variety of built-in Grok models that users can run locally, eliminating network restrictions. In addition, it also supports rapid deployment using idle Serv00 servers. The whole process is simple and suitable for individuals, teams or developers.

No direct access within the country Grok , utilizing this issue to provide Grok mirror sites. The program can quickly cash through Google Ads, only need to configure GOOGLEADS system variables. About 50 sets of accounts steadily support 2,000 people and earn 3 knives of revenue per day. Or use this method to attract traffic to cash on their own.

Grok-Mirror:一键部署可盈利的Grok镜像站-1

 

Function List

  • One-click deployment: quickly build local Grok kiosks via Docker or Serv00.
  • Multi-user support: allows multiple people to use it at the same time, and administrators can manage accounts and permissions.
  • API Interface: Provides/v1/chat/completionsChat API, consistent with OpenAI format.
  • Multi-model selection: supportgrok-2,grok-3and many other models.
  • Wall-free use: no need to rely on external networks after local deployment.
  • Token Management: Supports entering Sso Token and even batch importing multiple Token.
  • Data caching: Built-in caching mechanism to improve response speed.
  • Temporary Chat: The API supports temporary sessions without record keeping.

 

Using Help

Installation process (Docker way)

Grok-Mirror depends on Docker to run by default, the installation steps are as follows:

  1. Installing Docker
    Ensure that Docker is installed on your device.Windows and Mac users can download Docker Desktop, Linux users run it:

    sudo apt update && sudo apt install docker.io -y
    

    Check the version:

    docker --version
    
  2. Pulling Mirrors
    Enter it in the terminal:

    docker pull dairoot/grok-gateway:latest
    

    This will download the latest version of the Grok-Mirror image.

  3. Starting services
    Execute the following command to run the container:

    docker run --rm -p 50005:8080 -v grok_gateway_db:/app/.cache_data dairoot/grok-gateway:latest
    
    • -p 50005:8080: Maps container port 8080 to local port 50005.
    • -v grok_gateway_db:/app/.cache_data: Persistent storage of data.
      After startup, access thehttp://127.0.0.1:50005See if the service is running.
  4. Domain name configuration (optional)
    If extranet access is required, refer to the full deployment process to configure the domain name.

Rapid deployment tutorial (Serv00 approach)

If you have an idle Serv00 server, you can utilize it to quickly deploy Grok-Mirror.Here are the detailed steps:

I. Configuration in the Serv00 backend

  1. Configure the port
    Log in to the Serv00 backend, enter the "Firewall" settings, and add a custom port (e.g.50006).
    Grok-Mirror:一键部署可盈利的Grok镜像站-1
  2. Configuring Web Services
    Fill in the custom domain name in the backend (e.g.yourdomain.serv00.net) and the port you just created to complete the web service setup.
    Grok-Mirror:一键部署可盈利的Grok镜像站-1
  3. Editing Web Services
    Click on the web service you just created and selectManage -> Details, enter edit mode and make sure the settings are correct.
    Grok-Mirror:一键部署可盈利的Grok镜像站-1

Second, download Grok mirror station program

Download the Grok program by running the following command from the Serv00 terminal:

curl -L -o grok_gateway https://dairoot.cn/2025/03/06/serv00-grok/grok_gateway_freebsd_amd64

III. Operational procedures

  1. execute authority
    Enter the command:

    chmod +x grok_gateway
    
  2. Starting services
    Start the program with a custom port, e.g. port50006::

    ./grok_gateway -p 50006
    

IV. Access services

After deployment is complete, enter the custom domain name in your browser (e.g.http://yourdomain.serv00.net:50006) to access the Grok service.

Configuration steps

  1. Log in to the backstage
    Access the service address (e.g.http://127.0.0.1:50005) to get to the login page. The default administrator password needs to be passed through the environment variableADMIN_PASSWORDSettings, for example:

    docker run --rm -p 50005:8080 -e ADMIN_PASSWORD=yourpassword -v grok_gateway_db:/app/.cache_data dairoot/grok-gateway:latest
    

    The Serv00 method accesses the settings directly after the domain name.

  2. Enter Sso Token
    Get Sso Token method:

    • Log on to the xAI website (https://x.ai).
    • Press F12 to open Developer Tools and switch to the Network tab.
    • Refresh the page and find thenew-chatrequest, copy the Sso Token in the cookie.
    • Enter and save in the background "Token Management". Batch entry is supported, see later.
  3. test function
    Once the configuration is complete, go to the home page and enter text to test the dialog. If the result is returned, the service is normal.

API Usage

Grok-Mirror provides API support at/v1/chat/completionsThe

  1. Basic requests
    Tested with cURL:

    curl --location "http://127.0.0.1:50005/v1/chat/completions" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer YourSsoToken" \
    --data '{"model": "grok-2", "messages": [{"role": "user", "content": "你好!"}]}'
    
  2. Environment variable configuration
    This can be done with the environment variableAUTHORIZATIONSet the Token:

    docker run --rm -p 50005:8080 -e AUTHORIZATION=YourSsoToken -v grok_gateway_db:/app/.cache_data dairoot/grok-gateway:latest
    
  3. Support Models
    API Supportgrok-2,grok-3and other models, specifymodelParameter switching.

Featured Function Operation

  1. Batch Token Entry
    invocations/api/batch-add-grok-tokenInterface:

    curl -X POST "http://127.0.0.1:50005/api/batch-add-grok-token" \
    -H "Content-Type: application/json" \
    -d '{"sso_token_list": ["token1", "token2"]}'
    
  2. login interface
    • General Login:
    curl -X POST "http://127.0.0.1:50005/api/login" \
    -H "Content-Type: application/json" \
    -d '{"user_name": "test", "email_md5": "md5value"}'
    
    • V2 Login (with Token):
    curl -X POST "http://127.0.0.1:50005/api/login-v2" \
    -H "Content-Type: application/json" \
    -d '{"user_name": "test", "sso_token": "YourSsoToken"}'
    
  3. Get Grok List
    View available instances:

    curl -X POST "http://127.0.0.1:50005/api/get-grok-list" \
    -H "Content-Type: application/json" \
    -d '{"page": "1", "page_size": "10"}'
    

 

system variable

The following environment variables are supported by Grok-Mirror for customizing service configuration. These variables can be configured when starting a Docker container or Serv00 program via the-eparameter is passed in, e.g.docker run -e 变量名=值The

categorization variable name typology default value descriptive
API Related ADMIN_PASSWORD String None Password for accessing the administration backend. You need to specify it manually if it is not set, otherwise you cannot log in to the backend.
AUTHORIZATION String None API access key for polling a list of multi-account Sso Token. It is recommended to set this to automatically manage Token.
ENABLE_MIRROR_API Boolean true Whether to enable API access. Set tofalseshut down/v1/chat/completionsInterface.
MIRROR_API_PREFIX String None API access prefix, e.g. set toapiAfter that, the interface changes to/api/v1/chat/completions. Configuration is recommended to differentiate between paths.
API_HATD Boolean true Whether to enable temporary chat mode. The API does not save chat logs when enabled, suitable for testing or privacy needs.
system variable PROXY_URL_POOL String None Proxy pool links with multiple proxies separated by commas. The format is as followshttp://username:password@ip:portThe
HOST String None Service domain address for functions such as API return images. For examplehttps://example.comThe
GOOGLEADS String None Google Adsense advertising code for embedding ads on a page.

usage example

  1. Setting variables the Docker way
    Add the environment variable when you start the container:
docker run --rm -p 50005:8080 
-e ADMIN_PASSWORD=yourpassword 
-e AUTHORIZATION=YourSsoToken 
-v grok_gateway_db:/app/.cache_data 
dairoot/grok-gateway:latest
  1. Setting variables in Serv00 mode
    Before running the program, export the variables through the terminal:
export ADMIN_PASSWORD=yourpassword
export AUTHORIZATION=YourSsoToken
./grok_gateway -p 50006

 

application scenario

  1. Personal Learning Assistant
    After deploying Grok-Mirror, users can ask questions and get answers to their knowledge at any time, without the need for internet access to xAI.
  2. Team AI Tools
    Teams share a single local Grok kiosk with multi-user management capabilities to improve collaboration efficiency.
  3. Development test platforms
    Developers use API interfaces to test AI functionality, develop new applications or integrate existing systems.

 

QA

  1. Is Grok-Mirror free?
    The project itself is free and open source, but requires an xAI Grok account and Sso Token.
  2. Why did the API request fail?
    probeAuthorizationis correct, perhaps the Token is expired or not configured.
  3. What models are supported?
    be in favor ofgrok-2,grok-3and many other models, depending on the API return.

May not be reproduced without permission:Chief AI Sharing Circle " Grok-Mirror: one-click deployment of a profitable Grok mirror site
en_USEnglish