AI模型聚合管理中转分发系统,一个应用管理您的所有AI模型,支持将多种大模型转为统一格式调用,支持OpenAI、Claude、Gemini等格式,可供个人或者企业内部管理与分发渠道使用。

CaIon 578b5f6536 feat: support perplexity il y a 1 an
.github 1bfc46aa70 ci: update workflows il y a 1 an
bin d84b0b0f5d chore: add model parameter to the time_test script (#245) il y a 2 ans
common 578b5f6536 feat: support perplexity il y a 1 an
constant 4917e5a92f feat: 允许开关mj回调 il y a 1 an
controller a6ba1d01d9 feat: 添加回调未开启提示 il y a 1 an
dto 9b5353a81a feat: support InsightFace (close #60) il y a 1 an
i18n a721a5b6f9 chore: add error prompt for Azure il y a 2 ans
middleware d704902b70 feat: 兼容自定义变焦,完善modal操作 il y a 1 an
model f82aa956bd feat: midjourneys表添加索引 il y a 1 an
relay 578b5f6536 feat: support perplexity il y a 1 an
router 9b5353a81a feat: support InsightFace (close #60) il y a 1 an
service f65477d054 fix: 修复日志翻页问题 (close #122) il y a 1 an
web 2581b37394 fix: 侧边栏聚焦问题 (close #123) il y a 1 an
.gitignore 42451d9d02 refactor: update logging related logic il y a 2 ans
Dockerfile 7a4969c238 update Dockerfile il y a 2 ans
LICENSE 954ed893b9 Update LICENSE il y a 2 ans
Midjourney.md a26b9a9bff Update Midjourney.md il y a 1 an
README.md 652bb4a53c Update README.md il y a 1 an
VERSION 7e80e2da3a fix: add a blank VERSION file (#135) il y a 2 ans
docker-compose.yml cb92d6fd5f revert compose il y a 1 an
go.mod 2d2fec24d0 chore: update dependency il y a 1 an
go.sum 2d2fec24d0 chore: update dependency il y a 1 an
main.go 6013219f5b feat: 初步重构完成 il y a 1 an
makefile 699fe256d0 address comment il y a 1 an
one-api.service c6717307d0 chore: update one-api.service il y a 2 ans

README.md

New API

[!NOTE] 本项目为开源项目,在One API的基础上进行二次开发,感谢原作者的无私奉献。 使用者必须在遵循 OpenAI 的使用条款以及法律法规的情况下使用,不得用于非法用途。

[!WARNING] 本项目为个人学习使用,不保证稳定性,且不提供任何技术支持,使用者必须在遵循 OpenAI 的使用条款以及法律法规的情况下使用,不得用于非法用途。
根据《生成式人工智能服务管理暂行办法》的要求,请勿对中国地区公众提供一切未经备案的生成式人工智能服务。

[!NOTE] 最新版Docker镜像 calciumion/new-api:latest
更新指令 docker run --rm -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower -cR

主要变更

此分叉版本的主要变更如下:

  1. 全新的UI界面(部分界面还待更新)
  2. 添加Midjourney-Proxy(Plus)接口的支持,对接文档,支持的接口如下:
    • /mj/submit/imagine
    • /mj/submit/change
    • /mj/submit/blend
    • /mj/submit/describe
    • /mj/image/{id} (通过此接口获取图片,请必须在系统设置中填写服务器地址!!
    • /mj/task/{id}/fetch (此接口返回的图片地址为经过One API转发的地址)
    • /task/list-by-condition
    • /mj/submit/action (仅midjourney-proxy-plus支持,下同)
    • /mj/submit/modal
    • /mj/submit/shorten
    • /mj/task/{id}/image-seed
    • /mj/insight-face/swap (InsightFace)
  3. 支持在线充值功能,可在系统设置中设置,当前支持的支付接口:
    • 易支付
  4. 支持用key查询使用额度:
  5. 渠道显示已使用额度,支持指定组织访问
  6. 分页支持选择每页显示数量
  7. 兼容原版One API的数据库,可直接使用原版数据库(one-api.db)
  8. 支持模型按次数收费,可在 系统设置-运营设置 中设置
  9. 支持渠道加权随机
  10. 数据看板
  11. 可设置令牌能调用的模型
  12. 支持Telegram授权登录。
    1. 系统设置-配置登录注册-允许通过Telegram登录
    2. @Botfather输入指令/setdomain
    3. 选择你的bot,然后输入http(s)://你的网站地址/login
    4. Telegram Bot 名称是bot username 去掉@后的字符串

模型支持

此版本额外支持以下模型:

  1. 第三方模型 gps (gpt-4-gizmo-*)
  2. 智谱glm-4v,glm-4v识图
  3. Anthropic Claude 3 (claude-3-opus-20240229, claude-3-sonnet-20240229)
  4. Ollama,添加渠道时,密钥可以随便填写,默认的请求地址是http://localhost:11434,如果需要修改请在渠道中修改
  5. Midjourney-Proxy(Plus)接口,对接文档

您可以在渠道中添加自定义模型gpt-4-gizmo-*,此模型并非OpenAI官方模型,而是第三方模型,使用官方key无法调用。

部署

基于 Docker 进行部署

# 使用 SQLite 的部署命令:
docker run --name new-api -d --restart always -p 3000:3000 -e TZ=Asia/Shanghai -v /home/ubuntu/data/new-api:/data calciumion/new-api:latest
# 使用 MySQL 的部署命令,在上面的基础上添加 `-e SQL_DSN="root:123456@tcp(localhost:3306)/oneapi"`,请自行修改数据库连接参数。
# 例如:
docker run --name new-api -d --restart always -p 3000:3000 -e SQL_DSN="root:123456@tcp(localhost:3306)/oneapi" -e TZ=Asia/Shanghai -v /home/ubuntu/data/new-api:/data calciumion/new-api:latest

使用宝塔面板Docker功能部署

# 使用 SQLite 的部署命令:
docker run --name new-api -d --restart always -p 3000:3000 -e TZ=Asia/Shanghai -v /www/wwwroot/new-api:/data calciumion/new-api:latest
# 使用 MySQL 的部署命令,在上面的基础上添加 `-e SQL_DSN="root:123456@tcp(localhost:3306)/oneapi"`,请自行修改数据库连接参数。
# 例如:
# 注意:数据库要开启远程访问,并且只允许服务器IP访问
docker run --name new-api -d --restart always -p 3000:3000 -e SQL_DSN="root:123456@tcp(宝塔的服务器地址:宝塔数据库端口)/宝塔数据库名称" -e TZ=Asia/Shanghai -v /www/wwwroot/new-api:/data calciumion/new-api:latest
# 注意:数据库要开启远程访问,并且只允许服务器IP访问

Midjourney接口设置文档

对接文档

交流群

界面截图

image

image

image
image
image image 夜间模式
image

image
image

Star History

Star History Chart