# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: GT AI Gateway
spec:
    description: |
        GT AI Gateway is a lightweight AI gateway with OpenAI/Anthropic protocol conversion, request logging, user management, quotas, and traffic analysis. This template deploys the official Docker image with persistent SQLite data on Zeabur.
    icon: https://raw.githubusercontent.com/alexazhou/gt_ai_gateway/master/tauri/app-icon.svg
    variables:
        - key: PUBLIC_DOMAIN
          type: DOMAIN
          name: Public Domain
          description: The public domain for the GT AI Gateway web console and API endpoint.
    tags:
        - AI
        - API
        - Gateway
    readme: |
        # GT AI Gateway

        GT AI Gateway is a lightweight AI gateway for unified model API access, protocol conversion, request logging, user management, quotas, and traffic analysis.

        ## After Deployment

        Open the generated public domain and sign in with the `ROOT_TOKEN` value from the service environment variables. The token is generated automatically during deployment.

        ## Data Persistence

        This template stores the SQLite database and application logs in the `/app/data` volume.

        ## API Endpoint

        Use the same public domain as your model API gateway endpoint after configuring upstream providers and users in the admin console.
    services:
        - name: gt-ai-gateway
          icon: https://raw.githubusercontent.com/alexazhou/gt_ai_gateway/master/tauri/app-icon.svg
          template: PREBUILT_V2
          spec:
            id: gt-ai-gateway
            source:
                image: alexazhou/gt_ai_gateway:latest
            ports:
                - id: web
                  port: 8787
                  type: HTTP
            volumes:
                - id: data
                  dir: /app/data
            env:
                DB_PATH:
                    default: /app/data/local.db
                HOST:
                    default: 0.0.0.0
                LOG_DIR:
                    default: /app/data/log
                NODE_ENV:
                    default: production
                PORT:
                    default: "8787"
                RECORD_LOG_ENABLED:
                    default: "false"
                ROOT_TOKEN:
                    default: ${PASSWORD}
                    expose: true
                STREAM_LOG_ENABLED:
                    default: "false"
            healthCheck:
                type: TCP
                port: web
          domainKey: PUBLIC_DOMAIN
localization:
    en-US:
        description: |
            GT AI Gateway is a lightweight AI gateway with OpenAI/Anthropic protocol conversion, request logging, user management, quotas, and traffic analysis. This template uses the official Docker image and persists SQLite data on Zeabur.
        variables:
            - key: PUBLIC_DOMAIN
              type: DOMAIN
              name: Public Domain
              description: The public domain for the GT AI Gateway admin console and API endpoint.
        readme: |
            # GT AI Gateway

            GT AI Gateway is a lightweight AI gateway for unified model API access, protocol conversion, request logging, user management, quotas, and traffic analysis.

            ## After Deployment

            Open the generated public domain and sign in with the `ROOT_TOKEN` value from the service environment variables. The token is generated automatically during deployment.

            ## Data Persistence

            This template stores the SQLite database and application logs in the `/app/data` volume.

            ## API Endpoint

            Use the same public domain as your model API gateway endpoint after configuring upstream providers and users in the admin console.
    ja-JP:
        description: |
            GT AI Gateway は、OpenAI/Anthropic のプロトコル変換、リクエスト記録、ユーザー管理、利用量制御、トラフィック分析を備えた軽量な AI ゲートウェイです。このテンプレートは公式 Docker イメージを使い、Zeabur 上で SQLite データを永続化します。
        variables:
            - key: PUBLIC_DOMAIN
              type: DOMAIN
              name: 公開ドメイン
              description: GT AI Gateway の管理画面と API エンドポイントに使う公開ドメインです。
        readme: |
            # GT AI Gateway

            GT AI Gateway は、モデル API を統一して扱うための軽量な AI ゲートウェイです。プロトコル変換、リクエスト記録、ユーザー管理、利用量制御、トラフィック分析に対応しています。

            ## デプロイ後

            生成された公開ドメインを開き、サービス環境変数の `ROOT_TOKEN` で管理画面にサインインしてください。トークンはデプロイ時に自動生成されます。

            ## データ永続化

            このテンプレートでは、SQLite データベースとアプリケーションログを `/app/data` ボリュームに保存します。

            ## API エンドポイント

            管理画面で upstream provider とユーザーを設定したあと、同じ公開ドメインをモデル API のエンドポイントとして使います。
    zh-CN:
        description: |
            GT AI Gateway 是一个轻量级 AI 网关，支持 OpenAI/Anthropic 协议转换、请求记录、用户管理、额度控制和流量分析。本模板使用官方 Docker 镜像，并在 Zeabur 上持久化 SQLite 数据。
        variables:
            - key: PUBLIC_DOMAIN
              type: DOMAIN
              name: 公开域名
              description: 用于访问 GT AI Gateway 管理后台和 API 网关的公开域名。
        readme: |
            # GT AI Gateway

            GT AI Gateway 是一个轻量级 AI 网关，可用于统一模型 API 入口、协议转换、请求记录、用户管理、额度控制和流量分析。

            ## 部署后

            打开生成的公开域名，用服务环境变量里的 `ROOT_TOKEN` 登录管理后台。该 Token 会在部署时自动生成。

            ## 数据持久化

            本模板会把 SQLite 数据库和应用日志持久化到 `/app/data` 卷。

            ## API 地址

            在管理后台配置上游供应商和用户后，使用同一个公开域名作为模型 API 网关地址。
    zh-TW:
        description: |
            GT AI Gateway 是一個輕量級 AI 閘道，支援 OpenAI/Anthropic 協定轉換、請求記錄、使用者管理、額度控制與流量分析。本範本使用官方 Docker 映像，並在 Zeabur 上持久化 SQLite 資料。
        variables:
            - key: PUBLIC_DOMAIN
              type: DOMAIN
              name: 公開網域
              description: 用於存取 GT AI Gateway 管理後台與 API 閘道的公開網域。
        readme: |
            # GT AI Gateway

            GT AI Gateway 是一個輕量級 AI 閘道，可用於統一模型 API 入口、協定轉換、請求記錄、使用者管理、額度控制與流量分析。

            ## 部署後

            開啟產生的公開網域，使用服務環境變數中的 `ROOT_TOKEN` 登入管理後台。該 Token 會在部署時自動產生。

            ## 資料持久化

            本範本會將 SQLite 資料庫與應用程式日誌持久化到 `/app/data` 卷。

            ## API 位址

            在管理後台設定上游供應商與使用者後，使用同一個公開網域作為模型 API 閘道位址。
