Coder Social home page Coder Social logo

qabot-zh / new-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from calcium-ion/new-api

0.0 0.0 0.0 1.49 MB

基于One API的二次开发版本,仅供学习使用!

License: MIT License

Shell 0.15% JavaScript 43.86% Python 0.24% Go 55.31% CSS 0.24% HTML 0.07% Dockerfile 0.09% Makefile 0.05%

new-api's Introduction

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

new-api's People

Contributors

a497625414 avatar ai-ass avatar c121914yu avatar calcium-ion avatar chunzhimoe avatar ckt1031 avatar dependabot[bot] avatar ehco1996 avatar glzjin avatar guoruqiang avatar h1xy avatar igophper avatar jsubnew avatar luxlzz6 avatar miniers avatar mrhaoji avatar prnake avatar quentinhsu avatar quzard avatar shao0222 avatar shiqimei avatar sljeff avatar songquanpeng avatar v1cc0 avatar woodchen-ink avatar wxdadadada avatar xyfacai avatar yangfan-sys avatar yigmmk avatar yomiki avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.