Files
gpt-load/README.md
T
tbphp 08172b9e88 feat(web): implement the modern management frontend (#668)
* feat(web): 搭建新旧前端独立架构与界面切换

* feat(web): 设计珊瑚主题新版工作区框架

* refactor(web): 精调新版框架并移除预览占位内容

* fix(web): 隔离新版页面路由并恢复经典版启动

* fix(web): 修复页头菜单定位并精简导航提示

* feat(web): 优化导航布局并接入侧栏版本检查

* refactor(web): 精调侧栏底部外链与版本展示

* refactor(web): 整理侧栏外链并增加赞助入口

* refactor(web): 调整路由检查菜单与版本栏对齐

* Codex worktree snapshot: archive-cleanup

Co-authored-by: Codex

* fix(web): 恢复新版浮层组件样式

* feat(web): 完成新版登录认证与会话管理

* feat(web): 增加登录记忆选项并精简登录页

* fix(web): 独立展示访问密钥身份标识

* fix(modern): 调整快速导航触发器高度

* refactor(modern): 统一页面标题与设计令牌规范

* feat(modern): 完善分组工作区与公共框架

* feat(modern): 完善分组列表与公共组件

* feat(modern): 完成 API 密钥分组创建与模型批量选择

* feat(modern): 完善订阅分组创建与并行账号接入

* feat(modern): 完善分组详情与凭据管理

* feat(modern): 完善凭据卡片与高级配置交互

* feat(modern): 完善分组筛选并校正凭据统计

* feat(modern): 完善分组操作并统一消息与路由状态

* fix(modern): 统一凭据卡片底栏文字对齐

* feat(modern): 完善访问密钥管理与公共表单组件

* fix(modern): 区分页面与局部操作的加载反馈

* feat(modern): 完善请求日志页面与筛选展示

* refactor(modern): 精简日志表格字段与排版并降低渲染开销

表格只有单一字号、两档色阶,且每个配对单元格重复渲染表头已有的标签。
建立五档字号与三档色阶,数字列改等宽右对齐,删除格内标签。

字段配对从 7 组扩到 17 组并覆盖全部字段,避免非默认列各占一列;
细分缓存写入与两个完整性状态移出表格,仅保留在详情面板;
思考模式、强度、预算合并为一列,按强度、预算、开关的优先级取一,
等级保留上游原值不作翻译。列宽按内容与表头重排,全展开总宽减少约 480px。

表头与内容原先分属两个滚动容器、靠 JS 同步 scrollLeft,横向滚动有延迟,
改为同一容器内 sticky;行右内边距归零,固定列不再随滚动露出缝隙。

渲染上,AppOverflowText 仅在文字溢出时才创建 AppTooltip,
溢出检测共用一个 ResizeObserver,AppTooltip 的作用域属性改为缓存计算。

* refactor(modern): 重排日志高级筛选并精简筛选标签

* feat(modern): 统一协议标签并优化日志详情

* feat(modern): 完善请求日志展示与脱敏复制

* perf(modern): 减少页面切换等待与重复渲染开销

* fix(modern): 精简分页提示并缩小日期弹层

* feat(modern): 完善用量统计页面

* feat(modern): 支持日志字段快捷筛选

* feat(modern): 完善健康状态页面

* fix(health): 返回全部异常账号

* refactor(modern): 精简健康页并统一监控交互

* fix(brand): 统一品牌图形并修复刷新位置跳动

* feat(modern): 实现模型管理页面

* feat(modern): 完善全局设置页面

* fix(modern): 统一原生协议展示与弹窗确认焦点

* fix(modern): 优化全局滚动条体验

* refactor(modern): 模型卡片改为来源价格表格式并支持分组跳转

- 来源行改为与表头共用同一套列定义(来源/分组/4 项价格/计价方式/操作),
  多来源时价格上下对齐可比
- 协议折成一行中性摘要,悬浮查看完整列表,不再占用卡片最强的颜色
- 分组徽章对管理员改为可点击跳转到分组详情,非管理员保持纯展示
- 计价方式按常见程度分级:自动匹配为默认灰字,待计价才用警示徽章
- 卡片列表最小宽度从 320px 提到 620px 以容纳价格表;表格内容超宽时整体横向滚动

* fix(modern): 修正模型卡片价格溢出、行高不齐与列错位

- 价格列宽改为按本卡最长价格计算的共享变量:原先写死 52px,9 位小数的
  单价会溢出压到隔壁列;用 max-content 则表头与来源行各算各的导致列错位
- 来源单元格由 flex-wrap 改为网格:长渠道名原先会把图标、名称、档位各自
  甩到新行,单元格高度从 24px 涨到 87px
- 分组只展开第一个并禁止换行,超出交给 +N 提示,行高不再被撑乱
- 行内容压进 40px 下限,有无上游模型的行等高
- 溢出时行宽跟随内容,底色与分隔线不再在容器右边缘断掉
- 分组标签常态加描边,亮色下 subtle 几乎等于卡片白底、看不出可点

* feat(modern): 模型卡改多列排布并重做卡头视觉

- 网格改为 CSS 多列:来源数不同导致卡高不一,网格按行内最高的卡留空洞,
  实测同一批数据容器高从 616px 降到 576px 且无空洞
- 卡头加冷色渐变,自右上向左下淡出,左侧留白给模型名
- 新增 --modern-model-card-tint,沿用账号卡那套 info 蓝调,避开主色的橙
- 模型名靠左独占一端,协议/来源/分组三项统计右对齐

* refactor(modern): 精简模型详情侧边栏

- 去掉「全部来源」中间页:多来源靠顶部下拉切换即可,进面板直接落到
  第一个来源,随之移除返回箭头与只服务于该页的 ModelSourcePreview
- 面板宽度 sheet(660px) 改回 default(540px),与日志详情、访问密钥面板一致
- 价格由每档重复四个标签的块改为表格:表头只写一次,标准档与各阶梯档、
  各模式上下对齐可比,极端价格不再撑破容器
- 模型资料标签列定宽右对齐,原先 auto 会让每行按各自内容算宽而行间错位
- 关联分组去掉 AppButton>RouterLink>AppBadge 三层嵌套,改用与模型卡共用的
  可点标签样式(新增 model-group-chip.css)
- 清理随视图作废的样式与导入

* fix(modern): 换掉卡头底色并重排侧边栏价格表

- 卡头 tint 换成冷灰蓝 #e4ebf5/#2c3340,渐变两端都保留色:原先淡出到
  纯白,左下角与内容底色无差,所以区分不出卡头
- 修正上一轮未生效的改动:tint 仍混着 8% accent-soft(橙),当时单行
  replace 没匹配上已被格式化成多行的定义,且漏了断言
- 价格表单位说明移入表头首列,消掉标签列 225px 空白(占表宽 44%)
- 去掉价格表外框与表头底色,540px 侧栏里原先过重
- 价格四列收紧靠右(各 64px),数字挨在一起才便于比较
- 计价方式徽章移到「计价规则」分段标题行

* fix(modern): 卡头改用右上角径向晕染

照搬用量统计顶部卡片的手法:radial-gradient(ellipse at top right) 配低比例
混色,基色取成功绿。原先用线性渐变方向一直不对——to bottom left 会按盒子
比例换算,卡头宽高比约 15:1 时算出来接近 86°,等于水平色带;即便改成固定
225deg,扁盒子里的线性渐变也只是一条生硬的斜带,做不出角落发散的效果。

* feat(modern): 模型卡卡头晕染定为蓝调

基色改用 --modern-chart-input,与用量统计里 Token 卡同一支蓝,两页同源。

* fix(modern): 阶梯价入口仅保留标准档,Fast/Ultrafast 不再翻译

- Fast、Ultrafast 是计价档位专名(对应 OpenAI service_tier),三语一律不译
- 阶梯价的新增入口收窄到标准档:后端 NormalizeModePriceSchedules 直接驳回
  Fast 带阶梯,此前编辑器对所有档位都给了按钮,加完保存必然失败;
  Ultrafast 后端虽未拦截,按约定前端统一不做
- 非标准档改为提示「仅标准档支持阶梯价」,已存在的阶梯仍可见可删,
  避免静默隐藏却在保存时原样回传

* fix(modern): Fast 与 Ultrafast 档位行为对齐

后端对两档一视同仁:validPricingModeKey 只排除 standard,没有模型级限制;
计费同走 quote.go 查 ModeSchedules,仅触发参数不同(service_tier 取
fast/priority 与 ultrafast)。此前前端只给 Ultrafast 添加入口、删除按钮也
只对 Ultrafast 开放,目录同步来的 Fast 档因此无法删除。

- 添加入口改为按 optionalModes 渲染,两档对称
- 删除按钮放开到所有非标准档
- 阶梯价仍只在标准档提供(Fast 后端驳回,Ultrafast 按约定统一不做)

* fix(modern): 修正价格表头下方的边框重叠

选择器 .row + .row:not(--head) 把紧跟表头的第一个数据行也匹配进去了,
它的上边框与表头的下边框落在同一像素,叠出一条明显更粗的线。改为要求
前一项也是数据行。

* fix(frontend): 限制经典版入口为管理员

* refactor(modern): 精调全局设置页排版

- 状态徽章只在有状态时出现:17 个里 14 个是「默认」,等于反复声明
  「这里没什么特别的」,现仅剩已配置/已修改/环境锁定 3 个
- 设置项控件列由 auto 改为定宽,右边缘从 4 种位置收敛到 1 种
- 表单限宽 760px:内容区近 1000px,撑满会把标签与控件拉得过开
- 分区之间加细线隔断,功能边界不再只靠留白区分
- 子分组标题原先比它统领的设置项标签还小还淡,层级倒置;改用组标签
  质感(caption + 字距 + 延伸线)
- 移除「显示模式 / 界面语言」:右上角已有同样入口,此处重复
- 新版界面预览改用概念图:原先是 24KB 真实截图,与经典版的抽象示意
  图风格割裂;仓库里原有的 modern.svg 实为带虚线框的加号占位图,
  已按 classic.svg 的色板与抽象度重画为「左侧栏 + 卡片」
- 系统信息标签列定宽右对齐:原先 dt 用 flex:none 按各自文字宽度收缩,
  「数据库」与「管理员密钥来源」差近一倍,取值起点全部错开;
  三种更新状态也合并为一行

* refactor(modern): 梳理设置页布局与交互细节

* feat(modern): 完善吉祥物彩蛋与版本更新提示

* feat(modern): 补全总览与路由检查页面

* refactor(modern): 精简首页并整合路由检查

* feat(modern): 重做首页为接入优先布局

首页原本只展示分组、模型、凭据、密钥四个库存计数,这些数字一周不变,
且每个都对应侧边栏的一个导航项。真正回答「现在跑得怎么样」的
/api/home/statistics 接口后端早已实现,经典版在用,新版一直没接。

- 顶部换成一行状态条:服务状态 + 库存事实 + 版本与运行时长
- 接入客户端重做成左目录 + 按客户端类型分化的配置输出:
  CLI 客户端给可一次粘贴执行的终端命令(Codex 的 toml 改写成 heredoc),
  图形客户端给设置界面示意图与编号字段对照,可深链的把一键导入置顶
- 修掉 Cline 的缺口:它需要模型名但输出形态返回空块,
  界面上选了模型却没有任何地方显示,现在模型名是字段表的一行
- 协议不匹配改为选择前就在目录里禁用,提示里点名具体协议
- 路由检查折叠成工具条,不再以完整工作台占据首页
- 右栏依次为订阅账号、需要处理、24 小时请求趋势、访问密钥;
  需要处理由已有的分组数据推出,不额外请求健康接口,
  额度预警不重复(订阅账号已按账号画了额度条)

* refactor(modern): 精调首页接入面板与侧栏排版

上一版实现丢了设计稿里的若干排版细节,逐条补回:

- 客户端目录恢复协议标签。协议枚举全称有 16 个字符放不下,
  给 AppProtocolTag 加 short 模式取短名(Responses / Completions),
  颜色仍由同一处定义,不另写一套
- 界面示意图补上窗口标题栏文字,此前只画了三个点
- 没登记字段原文的客户端补两行无标签占位,示意图要读起来像一个设置表单,
  而不是「这个界面只有三个框」;不替没核实过的客户端编字段名
- 补上「把右边的值按编号填到左图对应的位置」的引导语
- 一键导入横幅不再复用确认对话框的文案(那句带问号),改用常驻横幅的说法
- 整段配置块的标题从裸的 JSON 改成「也可以直接复制完整配置」
- 状态条加入待办入口,与右栏面板共用 collectAttention 的同一份计数
- 订阅账号卡去掉「更新于」(页头已有整页刷新时间)、重置券并进页脚,
  并限制为前 3 个:账号多时这块会把下面三块全顶到折叠线以下

* fix(modern): 修正首页待办取材与侧栏面板的溢出

- 需要处理改读 /api/health。此前只按分组凭据计数判定,推不出额度将尽、
  充值卡临期、访问密钥被费用额度挡住这几类,健康实例上永远是空的,
  看起来就像坏了。现在覆盖无可用凭据、凭据被拉黑、额度将尽、
  充值卡临期、密钥受限五类,状态条计数与面板读同一份结果
- 订阅账号按设计改成一个账号一条进度条,取剩余最少的那个窗口;
  额度宽裕时不写重置时刻,可用是常态不出徽章
- 访问密钥不再溢出:grid 与 flex 子项的 min-width:auto 会让长密钥名
  把徽章顶出卡片,链路上每层都要显式解开;徽章与结论数字不参与压缩
- 补回 HomeAccounts 漏掉的 AppPanel 导入。Vue 对未注册组件不报错,
  整块面板被渲染成 <apppanel> 字面标签,标题与边框全部丢失
- 「还有 N 项」不再套用条目行的三列栅格,此前文字被挤进 14px 的
  图标列,一个字一行
- 待办条目以分组名优先收缩,说明文字先被截断;说明文字同时收短
- 接入面板去掉无用的副标题

* refactor(modern): 精调首页布局与接入交互

* fix(modern): 收紧首页布局并移除客户端协议限制

* fix(modern): 优化首页接入对齐与侧栏密度

* fix(modern): 记住客户端接入选择并修正订阅额度展示

* fix(modern): 统一客户端接入输入尺寸并精简说明

* fix(modern): 优化分组排序与订阅账号周期及并行同步

* fix(modern): 优化订阅额度周期与同步反馈

* fix(modern): 完善首页健康提醒与独立路由检查

* feat(modern): 增加额度窗口满额预估

* refactor(modern): decouple shared frontend utilities

* docs(readme): refresh localized screenshots

* fix(web): harden startup fallback and Group ID parsing
2026-09-16 21:56:51 +08:00

23 KiB
Raw Blame History

GPT-Load

GPT-Load

A self-hosted AI gateway for multi-channel, multi-credential setups

API keys, subscription accounts, traffic scheduling, failure handling, request logs, and usage accounting — behind a single entry point.

English · 中文 · 日本語 | Official Website

Release Docker Go License

tbphp/gpt-load | Trendshift Featured|HelloGitHub


Sponsors

Become a sponsor

Sponsor details (collapsible)
OfoxAI OfoxAI: Text, image, and video AI in one platform
OfoxAI is a unified AI API platform bringing together text, image, and video models from multiple providers. With OpenAI-compatible endpoints and native Anthropic and Gemini interfaces, developers can access models for AI applications, agents, and content creation through one platform. Explore OfoxAI models and APIs →
PackyCode PackyCode
Access leading AI models through PackyCode with one API endpoint and one API key. Enjoy fast, reliable access with automatic failover and dedicated high-speed routes for Codex and Claude Code. Get started with $1 in free credits, a discount on your first top-up, and savings of up to 80% on eligible routes. Pay in RMB with no currency conversion markups or extra top-up fees. Sign up through the link and start building today.
Fluxion AI One entry point to connect and manage the world's leading AI models
Fluxion AI serves individual developers, technical teams, and enterprises with a unified API for connecting to and managing leading AI models worldwide. Dynamic multi-route scheduling improves availability, while model performance, response times, and costs remain transparent and easy to review. Depending on the model and route, API calls can cost 40%–98% less than official or benchmark prices. Visit and sign up now to receive $7 in API credits. (Dedicated link)
AxisNow Protect and accelerate websites and APIs, serving users in mainland China and around the world, and extend acceleration and security capabilities to native/mobile apps through a client SDK — self-built private-deployment CDN | subscription-based high-protection CDN | an independently controllable, flexibly composable CDN network.
APIMart Thanks to APIMart for sponsoring this project! APIMart is a low-cost API platform for AI image & video generation — GPT-Image-2 from $0.006/image, 160+ images per dollar. One async API covers both image and video: submit a task, get an ID, fetch results via polling or callback. Batch tens of thousands of images without timeouts, switch models without changing code. Pay-as-you-go with no monthly fee — sign up here to get started.

Why GPT-Load

Your application only needs one base URL and one AccessKey. Providers, accounts, credentials, models, and routing policy are all configured in the management UI.

GPT-Load unified access and upstream routing architecture
  • One gateway, native protocols — Manage official APIs, cloud platforms, model services, and compatible relays together while clients keep their OpenAI, Anthropic, or Gemini native interfaces.
  • One mechanism for API keys and subscriptions — Codex, Claude, Antigravity, Grok, and API-key channels share credential management, scheduling, and health handling.
  • Scheduling and failure isolation built in — Multi-credential scheduling, configurable weights, retries, cooldown, blacklisting, and session affinity reduce the impact of overloaded or failing credentials.
  • Observable, self-hosted, and simple to deploy — Inspect health, routes, logs, usage, and cost estimates in an embedded UI backed by SQLite, MySQL, or PostgreSQL with local credential encryption.

Quick start

Warning

If you are using 1.x, read Moving from 1.x first. 2.0 cannot open, import, or migrate 1.x data in place.

1. Start the service

Requires Docker and Docker Compose.

git clone --depth 1 https://github.com/tbphp/gpt-load.git
cd gpt-load

cp .env.example .env
docker compose up -d

Confirm the service is up:

curl --fail http://127.0.0.1:3001/health

The first start generates a management key. Read it and store it safely:

docker compose exec gpt-load sh -c 'cat /app/data/auth.key'

Open http://127.0.0.1:3001 and sign in to the console with that key.

You can also set AUTH_KEY explicitly in .env before starting. By default the service listens on the loopback address only and is not exposed to the internet.

2. Initial configuration

Initial setup takes three steps:

  1. Add a channel — Choose an upstream service and add one or more API keys. For subscription channels, complete the OAuth flow or import credentials as prompted.
  2. Create a group — Pick a channel, then configure available models and runtime policy.
  3. Create an AccessKey — Set the groups and client protocols it may use, then give the generated AccessKey to your application.
OAuth callback ports for subscription channels

The Codex, Claude, and Antigravity OAuth clients use fixed callback ports. Compose publishes them on the address configured by HOST, which defaults to 127.0.0.1; setting HOST=0.0.0.0 also publishes these callback ports on all host interfaces. Because the ports are fixed by the upstream clients, only one default Compose instance can run on a host at a time.

When working over SSH or from a remote browser, the browser's localhost may not reach GPT-Load — paste the full callback URL into the authorization dialog to finish the flow.

Screenshots

Groups — View channels, models, credential counts, traffic, and health in one place

GPT-Load modern groups overview

Usage statistics — Review request trends, cache hit rate, token categories, and cost estimates

GPT-Load modern usage statistics

Scope

Client protocols

Protocol Main entry
OpenAI Chat Completions POST /v1/chat/completions
OpenAI Responses /v1/responses and its resource paths
OpenAI Images POST /v1/images/...
OpenAI Embeddings POST /v1/embeddings
Rerank POST /v1/rerank
Anthropic Messages POST /v1/messages
Gemini /v1beta/models/...

Each channel declares exactly which protocols and capabilities it can execute. GPT-Load converts between supported capabilities, but it is not a general-purpose any-protocol, any-JSON translator.

Embeddings initially uses the native OpenAI-compatible wire only on the OpenAI, OpenRouter, and OpenAI Compatible API-key channels; subscription channels and protocol conversion are not supported. An AccessKey without a protocol filter keeps its existing “all enabled protocols” behavior and therefore gains Embeddings access after upgrade. Least-privilege deployments should configure an explicit protocol filter.

Rerank uses the independent rerank protocol through POST /v1/rerank on the OpenAI Compatible, New API, and GPT-Load API-key channels. Requests contain model, query, and a text-only documents array, with optional upstream parameters such as top_n and return_documents. Streaming, subscription channels, and protocol conversion are not supported. OpenAI Compatible takes a complete API prefix (for example, https://host/v1); New API / GPT-Load take the gateway root. The upstream must implement a compatible Rerank endpoint. AccessKeys without a protocol filter also gain Rerank access. Responses containing only non-token units such as search_units remain unpriced; these units are not treated as tokens or free requests.

Built-in channels

  • Official and cloud — OpenAI, Anthropic, Gemini, xAI, Azure OpenAI, AWS Bedrock, Google Vertex AI
  • Model services — DeepSeek, Moonshot AI, SiliconFlow, Zhipu AI, Alibaba, Volcengine, OpenRouter, Groq
  • Subscription — Codex, Claude, Antigravity, Grok
  • Custom — OpenAI Compatible (any compatible relay)

Deployment and data

Docker Compose uses application-managed SQLite by default. Data lives in the gpt-load-data named volume and includes the database, auth.key, and encryption.key.

Important

encryption.key decrypts channel credentials. When backing up or migrating, the database and the key must be kept together. Once the key is lost or replaced, existing encrypted credentials cannot be recovered, and this version does not support master key rotation.

Using an external database

Use the unified DATABASE_DSN to connect SQLite, MySQL, or PostgreSQL:

mysql://user:password@db.example:3306/gpt_load?charset=utf8mb4&collation=utf8mb4_bin
postgres://user:password@db.example:5432/gpt_load?sslmode=require

Common operations:

docker compose logs -f      # view logs
docker compose pull && docker compose up -d   # update to the latest 2.x image
docker compose stop         # stop the service

The official Compose file uses ghcr.io/tbphp/gpt-load:2. Before GA, 2 tracks verified 2.0 Beta and RC releases; after GA, it tracks stable 2.x releases only. Exact image tags omit the Git tag's v prefix (for example, 2.0.0-beta.25), while 2.0-beta remains the 2.0 Beta channel. latest remains on 1.x.

Using a native binary

Download the build for your platform from GitHub Releases, and verify it against the bundled SHA256SUMS first:

chmod +x ./gpt-load-linux-amd64

HOST=127.0.0.1 DATA_DIR=./data ./gpt-load-linux-amd64

Then open http://127.0.0.1:3001. Portable builds are provided for five targets across Linux, macOS (amd64 / arm64), and Windows; gpt-load-windows-amd64.exe keeps running in the foreground as before.

Windows desktop users can instead download gpt-load-windows-setup.exe. After one administrator approval, Setup installs and starts a low-privilege Windows service, enables automatic startup, and creates desktop and Start Menu shortcuts to the GPT-Load management page. Setup displays the generated management key before it finishes; save it before closing the page. The protected copy remains at %ProgramData%\GPT-Load\data\auth.key. Service configuration and its .env live in %ProgramData%\GPT-Load, with persistent data in %ProgramData%\GPT-Load\data.

Installing a newer Setup stops the service gracefully before updating it. Windows uninstall removes the program and service but preserves data. Advanced users can still manage an installed service with gpt-load-windows-amd64.exe service start|stop|restart|status.

Environment configuration

At startup, the application reads .env in the current directory; existing process environment variables take precedence. Unless noted otherwise, changes require restarting the process or container; see .env.example for the common configuration template.

Show all environment variables
Variable Default Description
HOST 127.0.0.1 Native listening address, and the default host address for Compose's main port and OAuth callback ports; Compose always listens on 0.0.0.0 inside the container.
PORT 3001 HTTP service port, must be 1–65535; Compose also uses it for the container port, host publishing, and health check.
BIND_ADDRESS Empty, inherits HOST Compose only; overrides the host publishing address for the main service port without changing OAuth callback ports.
OAUTH_CALLBACK_BIND_ADDRESS Empty, inherits HOST Compose only; overrides the host publishing address for the fixed OAuth callback ports 1455, 54545, and 51121.
GRACEFUL_SHUTDOWN_TIMEOUT 10 Maximum time to wait for requests after a stop signal, positive integer in seconds.
CONTAINER_STOP_GRACE_PERIOD 15s Docker duration to wait before Compose force-stops the container; should be longer than GRACEFUL_SHUTDOWN_TIMEOUT.
READ_TIMEOUT 60 HTTP request read timeout, positive integer in seconds.
IDLE_TIMEOUT 120 HTTP keep-alive idle connection timeout, positive integer in seconds.
DATA_DIR ./data Directory for the managed database, auth.key, encryption.key, and runtime state; official Compose uses /app/data, while the Windows Setup service uses %ProgramData%\GPT-Load\data.
DATABASE_DSN Empty, uses ${DATA_DIR}/gpt-load.db Empty uses application-managed SQLite; non-empty values support SQLite paths or URLs, MySQL URLs, and PostgreSQL URLs, and are treated as operator-managed external databases. Container file paths must be inside a mounted directory.
DATABASE_MAX_OPEN_CONNECTIONS 10 Maximum open connections for MySQL and PostgreSQL, positive integer. SQLite always uses one connection.
DATABASE_MAX_IDLE_CONNECTIONS 5 Maximum idle connections for MySQL and PostgreSQL, positive integer and no greater than DATABASE_MAX_OPEN_CONNECTIONS. SQLite always uses one connection.
AUTH_KEY Empty, reads or generates ${DATA_DIR}/auth.key Bearer key for the management UI and /api management API, not a data-plane AccessKey.
ENCRYPTION_KEY Empty, reads or generates ${DATA_DIR}/encryption.key Encrypts channel credentials; changing or losing it makes existing credentials undecryptable, so back it up with the database.
HTTP_PROXY Empty Environment proxy for HTTP upstream requests.
HTTPS_PROXY Empty Environment proxy for HTTPS upstream requests.
NO_PROXY Empty Comma-separated hosts, domains, or IPs that bypass the environment proxy.
LOG_LEVEL info Supports panic, fatal, error, warn, warning, info, debug, and trace; invalid values warn and fall back to info.
LOG_FORMAT text Supports text and json; any other value fails startup.
MODELS_DEV_AUTO_SYNC_ENABLED Unset, initial default true When unset, uses the persisted management UI setting; when set, forces Models.dev auto-sync on or off and makes the same UI option read-only.

Environment proxies apply only when no proxy is specified on the credential, group, or global settings.

Production considerations

  • The service listens on 127.0.0.1 only by default. For remote access, expose it through a controlled network or a TLS reverse proxy, and configure ACLs and firewall rules.
  • Manage AUTH_KEY and ENCRYPTION_KEY carefully. Never commit real keys to a repository, log, screenshot, or public issue.
  • 2.0 is designed for a single application instance. Instances do not share state, so horizontal scaling is not supported.
  • Usage and cost are estimates derived from upstream responses. They support operational analysis and capacity planning, and do not equal a provider invoice or a financial reconciliation.
  • Subscription channels depend on upstream OAuth and compatibility protocols and may change as upstreams change. Only connect accounts you are entitled to use, and follow each provider's terms.
  • HTTP Responses continuation with previous_response_id automatically uses native Responses routes that declare upstream-managed storage: currently openai, gpt_load, xai, newapi, cliproxyapi, and sub2api. Ownership is isolated by AccessKey and pins the original credential when current routing permits, independently of soft affinity; actual state availability depends on the upstream. Stateless and converted responses are not registered as persistent state. Unknown IDs, including IDs created before upgrading or outside this gateway, are rejected. Group parameter overrides cannot change this field.
  • Native Responses WebSocket uses GET /v1/responses on the same port. Admission follows declared upstream capabilities for OpenAI, xAI, Codex, and compatible native CPA/sub2api and GPT-Load endpoints. Clients may include the boolean stream:true/false; both values still use the WS event stream. Each turn checks current permissions, rate and cost limits, and routing, with separate usage and cost records. One connection keeps one upstream identity; there is no HTTP fallback or conversation-history replay.
  • responses_websocket_enabled defaults to enabled. An explicit group setting overrides the global value; otherwise the group inherits it. Disabling immediately closes affected WS connections and interrupts generation without affecting HTTP/SSE. Re-enabling does not restore the old connection's temporary state.
  • Full stream_id multiplexing and forks are enabled for OpenAI and GPT-Load cascades that support them end to end. The other channels above run serially and reject named streams. Prewarming sends generate:false upstream. Codex continuation requires the original live connection: store:true and restoration by an old ID on a new connection are unsupported. Persistent continuation on other channels depends on storage capabilities and valid ownership. Existing Codex SDK proxy, reading, and shutdown limits still apply.
  • Response bindings stay in memory for up to 30 days, with limits of 100,000 entries and 16 MiB of ID text; older entries are evicted when capacity is reached. A successful checkpoint during normal shutdown allows restoration from the same data directory. Crash recovery and continued upstream state availability are not guaranteed.
  • conversation and other existing resource IDs are outside this ownership routing scope and still depend on a single credential or upstream resource sharing across credentials.

Moving from 1.x

Warning

GPT-Load 2.0 is a complete rewrite. It cannot open, import, or migrate 1.x data in place.

Deploy 2.0 with its own database, DATA_DIR, port, and Docker volume. Cut traffic over only after verification, and keep the original 1.x deployment until the rollback window closes. Documentation for the 1.4.x maintenance line is at the official docs.

Open-source dependencies

Some of GPT-Load's capabilities build on these projects, with thanks:

Project Role License
Bifrost Core Provider authentication, request/response conversion, streaming, usage normalization Apache-2.0
CLIProxyAPI OAuth and execution adapter for subscription channels MIT
Lobe Icons Channel brand icons in the management UI MIT

GPT-Load owns credential storage, account selection, scheduling, retry, health, affinity, logging, and usage policy. Third-party notices are in THIRD_PARTY_NOTICES.md, full license texts in LICENSES/, and each release ships a CycloneDX SBOM covering the Go dependency graph.

Channel icons identify their respective upstream providers. All trademarks belong to their owners; this project is not affiliated with or endorsed by them.

Project support

OpenAI
Platform support
LINUX DO
Community support
DigitalOcean
Infrastructure support

MIT License · Third-party notices · Security policy