Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

通过 API 管理 OneAPI 的用户、渠道、后台等 #1726

Closed
1 task done
RexWzh opened this issue Aug 9, 2024 · 1 comment
Closed
1 task done

通过 API 管理 OneAPI 的用户、渠道、后台等 #1726

RexWzh opened this issue Aug 9, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@RexWzh
Copy link

RexWzh commented Aug 9, 2024

例行检查

  • 我已确认目前没有类似 issue

功能描述

通过命令行与 OneAPI 进行交互,包括用户管理,渠道编辑及后台设置等。

应用场景

当渠道较多,且存在频繁更新变动时,通过代码可以方便地进行管理和更新。

用 Python 写了一个管理用户和渠道简单的 demo

https://nbviewer.org/github/RexWzh/one-api-cli/blob/main/demo/one-api.ipynb

项目仓库里没有 openapi.yaml 之类的接口文件。但开发过程应该有接口文档的吧?如果可以导出文件,通过 OpenAPI-Generator 能直接生成需要语言的代码,比如生成 Python

openapi-generator generate -i openapi.yaml -g python -o ./client

另外, 如果账号后续升级为组织号(#1540 ),可以在组织账号下维护一个 API 工具。

关联的 Issue:

@RexWzh RexWzh added the enhancement New feature or request label Aug 9, 2024
@RexWzh RexWzh changed the title 通过 API 管理模型渠道 通过 API 管理 OneAPI 的用户、渠道、后台等 Aug 9, 2024
@RexWzh
Copy link
Author

RexWzh commented Aug 20, 2024

#1754

@RexWzh RexWzh closed this as completed Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant