├── VERSION ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.md │ └── bug_report.md └── workflows │ ├── macos-release.yml │ ├── windows-release.yml │ ├── docker-image-amd64-en.yml │ ├── docker-image-amd64.yml │ ├── linux-release.yml │ └── docker-image-arm64.yml ├── img.png ├── img_1.png ├── img_10.png ├── img_11.png ├── img_12.png ├── img_13.png ├── img_14.png ├── img_15.png ├── img_16.png ├── img_17.png ├── img_18.png ├── img_19.png ├── img_2.png ├── img_20.png ├── img_21.png ├── img_22.png ├── img_23.png ├── img_24.png ├── img_25.png ├── img_26.png ├── img_27.png ├── img_28.png ├── img_29.png ├── img_3.png ├── img_30.png ├── img_31.png ├── img_32.png ├── img_4.png ├── img_5.png ├── img_6.png ├── img_7.png ├── img_8.png ├── img_9.png ├── web ├── vercel.json ├── public │ ├── logo.png │ ├── favicon.ico │ ├── robots.txt │ └── index.html ├── src │ ├── helpers │ │ ├── history.js │ │ ├── index.js │ │ ├── auth-header.js │ │ ├── api.js │ │ ├── render.js │ │ └── utils.js │ ├── constants │ │ ├── common.constant.js │ │ ├── index.js │ │ ├── toast.constants.js │ │ ├── user.constants.js │ │ └── channel.constants.js │ ├── pages │ │ ├── Log │ │ │ └── index.js │ │ ├── Chat │ │ │ └── index.js │ │ ├── User │ │ │ ├── index.js │ │ │ └── AddUser.js │ │ ├── Token │ │ │ ├── index.js │ │ │ └── EditToken.js │ │ ├── Channel │ │ │ └── index.js │ │ ├── Redemption │ │ │ ├── index.js │ │ │ └── EditRedemption.js │ │ ├── NotFound │ │ │ └── index.js │ │ ├── Setting │ │ │ └── index.js │ │ ├── About │ │ │ └── index.js │ │ ├── TopUp │ │ │ └── index.js │ │ └── Home │ │ │ └── index.js │ ├── components │ │ ├── PrivateRoute.js │ │ ├── Loading.js │ │ ├── Footer.js │ │ ├── GitHubOAuth.js │ │ ├── PasswordResetForm.js │ │ └── PasswordResetConfirm.js │ ├── context │ │ ├── User │ │ │ ├── reducer.js │ │ │ └── index.js │ │ └── Status │ │ │ ├── reducer.js │ │ │ └── index.js │ ├── index.css │ └── index.js ├── .gitignore ├── README.md └── package.json ├── .gitignore ├── qrcode_1730792856655.jpg ├── bin ├── migration_v0.2-v0.3.sql ├── migration_v0.3-v0.4.sql └── time_test.sh ├── common ├── validate.go ├── crypto.go ├── gin.go ├── embed-file-system.go ├── group-ratio.go ├── init.go ├── logger.go ├── rate-limit.go ├── email.go ├── redis.go ├── custom-event.go ├── verification.go ├── model-ratio.go └── utils.go ├── middleware ├── cache.go ├── cors.go ├── turnstile-check.go ├── rate-limit.go ├── auth.go └── distributor.go ├── controller ├── group.go ├── billing.go ├── option.go ├── channel.go ├── wechat.go ├── log.go ├── redemption.go ├── relay-openai.go ├── relay-audio.go ├── github.go ├── token.go ├── relay-utils.go └── misc.go ├── one-api.service ├── router ├── dashboard.go ├── main.go ├── web-router.go ├── relay-router.go └── api-router.go ├── Dockerfile ├── docker-compose.yml ├── LICENSE ├── i18n └── translate.py ├── model ├── ability.go ├── main.go ├── redemption.go ├── channel.go ├── cache.go └── log.go ├── go.mod └── main.go /VERSION: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ['https://iamazing.cn/page/reward'] -------------------------------------------------------------------------------- /img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img.png -------------------------------------------------------------------------------- /img_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_1.png -------------------------------------------------------------------------------- /img_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_10.png -------------------------------------------------------------------------------- /img_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_11.png -------------------------------------------------------------------------------- /img_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_12.png -------------------------------------------------------------------------------- /img_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_13.png -------------------------------------------------------------------------------- /img_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_14.png -------------------------------------------------------------------------------- /img_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_15.png -------------------------------------------------------------------------------- /img_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_16.png -------------------------------------------------------------------------------- /img_17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_17.png -------------------------------------------------------------------------------- /img_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_18.png -------------------------------------------------------------------------------- /img_19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_19.png -------------------------------------------------------------------------------- /img_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_2.png -------------------------------------------------------------------------------- /img_20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_20.png -------------------------------------------------------------------------------- /img_21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_21.png -------------------------------------------------------------------------------- /img_22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_22.png -------------------------------------------------------------------------------- /img_23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_23.png -------------------------------------------------------------------------------- /img_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_24.png -------------------------------------------------------------------------------- /img_25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_25.png -------------------------------------------------------------------------------- /img_26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_26.png -------------------------------------------------------------------------------- /img_27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_27.png -------------------------------------------------------------------------------- /img_28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_28.png -------------------------------------------------------------------------------- /img_29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_29.png -------------------------------------------------------------------------------- /img_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_3.png -------------------------------------------------------------------------------- /img_30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_30.png -------------------------------------------------------------------------------- /img_31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_31.png -------------------------------------------------------------------------------- /img_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_32.png -------------------------------------------------------------------------------- /img_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_4.png -------------------------------------------------------------------------------- /img_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_5.png -------------------------------------------------------------------------------- /img_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_6.png -------------------------------------------------------------------------------- /img_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_7.png -------------------------------------------------------------------------------- /img_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_8.png -------------------------------------------------------------------------------- /img_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/img_9.png -------------------------------------------------------------------------------- /web/vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "github": { 3 | "silent": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .vscode 3 | upload 4 | *.exe 5 | *.db 6 | build 7 | *.db-journal -------------------------------------------------------------------------------- /web/public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/web/public/logo.png -------------------------------------------------------------------------------- /web/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/web/public/favicon.ico -------------------------------------------------------------------------------- /web/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /qrcode_1730792856655.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akl7777777/shell-api/HEAD/qrcode_1730792856655.jpg -------------------------------------------------------------------------------- /web/src/helpers/history.js: -------------------------------------------------------------------------------- 1 | import { createBrowserHistory } from 'history'; 2 | 3 | export const history = createBrowserHistory(); -------------------------------------------------------------------------------- /web/src/constants/common.constant.js: -------------------------------------------------------------------------------- 1 | export const ITEMS_PER_PAGE = 10; // this value must keep same as the one defined in backend! 2 | -------------------------------------------------------------------------------- /web/src/helpers/index.js: -------------------------------------------------------------------------------- 1 | export * from './history'; 2 | export * from './auth-header'; 3 | export * from './utils'; 4 | export * from './api'; -------------------------------------------------------------------------------- /bin/migration_v0.2-v0.3.sql: -------------------------------------------------------------------------------- 1 | UPDATE users 2 | SET quota = quota + ( 3 | SELECT SUM(remain_quota) 4 | FROM tokens 5 | WHERE tokens.user_id = users.id 6 | ) 7 | -------------------------------------------------------------------------------- /web/src/constants/index.js: -------------------------------------------------------------------------------- 1 | export * from './toast.constants'; 2 | export * from './user.constants'; 3 | export * from './common.constant'; 4 | export * from './channel.constants'; -------------------------------------------------------------------------------- /common/validate.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "github.com/go-playground/validator/v10" 4 | 5 | var Validate *validator.Validate 6 | 7 | func init() { 8 | Validate = validator.New() 9 | } 10 | -------------------------------------------------------------------------------- /web/src/constants/toast.constants.js: -------------------------------------------------------------------------------- 1 | export const toastConstants = { 2 | SUCCESS_TIMEOUT: 1500, 3 | INFO_TIMEOUT: 3000, 4 | ERROR_TIMEOUT: 5000, 5 | WARNING_TIMEOUT: 10000, 6 | NOTICE_TIMEOUT: 20000 7 | }; 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: 项目群聊 4 | url: https://openai.justsong.cn/ 5 | about: QQ 群:828520184,自动审核,备注 One API 6 | - name: 赞赏支持 7 | url: https://iamazing.cn/page/reward 8 | about: 请作者喝杯咖啡,以激励作者持续开发 9 | -------------------------------------------------------------------------------- /web/src/pages/Log/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Header, Segment } from 'semantic-ui-react'; 3 | import LogsTable from '../../components/LogsTable'; 4 | 5 | const Token = () => ( 6 | <> 7 | 8 | 9 | ); 10 | 11 | export default Token; 12 | -------------------------------------------------------------------------------- /web/src/helpers/auth-header.js: -------------------------------------------------------------------------------- 1 | export function authHeader() { 2 | // return authorization header with jwt token 3 | let user = JSON.parse(localStorage.getItem('user')); 4 | 5 | if (user && user.token) { 6 | return { 'Authorization': 'Bearer ' + user.token }; 7 | } else { 8 | return {}; 9 | } 10 | } -------------------------------------------------------------------------------- /web/src/pages/Chat/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const Chat = () => { 4 | const chatLink = localStorage.getItem('chat_link'); 5 | 6 | return ( 7 |