跳到主要内容

账户、计费与 API Keys

在 Settings 中管理账户、执行机器、计费状态、API keys 和应用偏好。

Account​

Account 区域包含 profile、subscription、credits 和已连接的 OAuth accounts。

Profile​

在 Settings -> Profile 中可以更新:

  • 头像
  • 用户名
  • 邮箱地址

用户名和邮箱必须唯一。如果另一个账户已经使用该值,应用会显示校验错误。

OAuth Accounts​

连接 OAuth accounts 后,Agentrix 才能代表你访问 GitHub 或 GitLab 等 providers。Repository mode 会使用这些连接列出仓库、issues 和 MRs。

如果仓库访问失败,回到 Settings 确认对应 OAuth account 是否已连接。

Subscription​

打开 Settings -> Subscription 可以查看当前 plan 和可用 plans。当部署启用了 billing 后,该页面可以:

  • 显示当前 plan、续费或到期日期、月费和包含的 credits。
  • 打开 customer portal 管理现有订阅。
  • 为新 plan 启动 checkout。
  • 显示 plan features,并在配置后标记 popular plan。

如果页面显示 subscription features are not configured,说明当前部署环境的管理员没有启用 billing。

Credits​

打开 Settings -> Credits 可以查看账户余额、有效 credit packages 和交易历史。

Credits 页面会显示:

  • 当前总余额。
  • 有效 credit buckets 和过期时间。
  • 可用时显示充值入口。
  • Recharge 和 usage 交易历史。

如果最近的支付或用量记录还没出现,可以刷新页面。Credits 页面打开时,应用也会通过 WebSocket 监听 billing 更新。

Devices​

Local Machines​

打开 Settings -> Local Machines 可以查看绑定到账户的机器。列表会显示在线状态、host 信息、平台和 CLI 版本。

你可以在这里 unbind local machine。解绑会移除这台机器与账户的关联;下一次在该机器上运行 agentrix start 时,需要重新认证。

Private Clouds​

打开 Settings -> Private Clouds 可以创建和管理团队 runner pool。Private Clouds 的完整说明见 Private Cloud 部署。

Preferences​

Preferences 区域可以调整:

  • Layout
  • Theme 和 appearance
  • Language

这些偏好只影响应用 UI,不会改变 daemon 行为。

Privacy​

打开 Settings -> Privacy 可以查看、复制或修改本地账户 entry password。应用的加密和恢复流程会用到它。

请把这个 password 当作敏感信息处理。拥有该 password 和必要账户上下文的人,可能恢复受保护的数据。

API Keys​

API keys 用于 agentrix-run、GitHub Actions、GitLab CI 和自定义脚本等自动化场景。

打开 Settings -> API Keys 可以:

  • 用名称创建 key。
  • 在 reveal modal 中一次性复制完整 key。
  • 查看 key prefix、last-used time、expiry 和 enabled 状态。
  • 删除不再使用的 keys。

请把 API keys 存到 secret manager 或 CI secret store。Agentrix 只会在创建后立即显示完整 key。

API Key 可访问的常用只读接口​

API key 可以作为 bearer token 调用下列常用只读接口。部分接口会返回 secret、加密 key 或带凭证的 URL,请按敏感信息处理:

Authorization: Bearer YOUR_API_KEY
范围接口说明
账户GET /v1/auth/me查询当前用户资料、OAuth accounts 和 Git server accounts。
API KeysGET /v1/api-keys查询当前账户的 API key metadata。不会再次返回完整 key。
计费GET /v1/billing/balance查询当前 credits 余额。
计费GET /v1/billing/packages查询当前账户的 credit packages。
计费GET /v1/billing/transactions查询当前账户的交易记录。
计费GET /v1/billing/transactions/task/:taskId查询指定 task 的计费交易。
计费GET /v1/billing/stats查询当前账户的用量统计。
订阅GET /v1/subscription查询当前订阅和 entitlement。
配置GET /v1/openapi-config查询 LLM gateway base URL、默认 API key 和模型配置。请按敏感信息处理。
Environment VariablesGET /v1/environment-variables查询指定 owner 的 environment variables。需要当前账户拥有该 owner。
Local MachinesGET /v1/machines查询当前账户可用的 local machines、cloud runners 和 private cloud runners。Local machine 条目会包含该账户的 dataEncryptionKey。
Local MachinesGET /v1/machines/:machineId/models查询指定 local machine 当前可用的模型。机器必须在线。
Private CloudsGET /v1/machines/clouds/:cloudId/models查询指定 private cloud runner 当前可用的模型。runner 必须在线。
Private CloudsGET /v1/private-clouds查询当前账户加入的 private clouds 和 private cloud entitlement。
Private CloudsGET /v1/private-clouds/:id/machines查询指定 private cloud 的 runner machines。
Private CloudsGET /v1/private-clouds/:id/members查询指定 private cloud 的成员列表。
Private CloudsGET /v1/private-clouds/:id/runner-secret查询 runner secret。只有 owner 或 admin 应调用;请按 secret 处理。
Auth RequestsGET /v1/auth/machine/status查询指定 local machine auth request 的审批状态。
Auth RequestsGET /v1/auth/cloud查询 private cloud join request 的审批结果。
Auth RequestsGET /v1/auth/cloud/status查询指定 private cloud join request 的 pending 状态。
WorkspacesGET /v1/workspaces查询当前账户的 workspaces。
ChatsGET /v1/chats查询当前账户可访问的 chats。
ChatsGET /v1/chats/:chatId查询 chat 详情。
ChatsGET /v1/chats/:chatId/members查询 chat 成员。
ChatsGET /v1/chats/:chatId/tasks查询 chat 下的 tasks。
TasksGET /v1/tasks查询 task 列表。
TasksGET /v1/tasks/:taskId查询 task 详情。
TasksGET /v1/tasks/:taskId/events查询 task event 历史。
TasksGET /v1/tasks/:taskId/patch查询 task patch。
TasksGET /v1/tasks/:taskId/project/*读取 task workspace 中的项目文件。
TasksGET /v1/tasks/:taskId/channel-attachment读取 channel attachment。
TasksGET /v1/tasks/sub-tasks查询直接子任务。
TasksGET /v1/tasks/recent查询最近 tasks。
TasksGET /v1/tasks/find-by-agent按 agent 查询已有 task。
RepositoriesGET /v1/inbox查询当前账户的 repository inbox。
RepositoriesGET /v1/repos/install-url查询 GitHub App installation URL。
RepositoriesGET /v1/repos查询当前账户授权的 repositories。
RepositoriesGET /v1/repos/:repoId按 repository ID 查询详情。
RepositoriesGET /v1/repos/:repoId/inbox查询指定 repository 的 inbox。
RepositoriesGET /v1/repos/:owner/:repo按 owner/name 查询 repository。
RepositoriesGET /v1/repos/:owner/:repo/git-url查询带凭证的 Git URL。请按敏感信息处理。
RepositoriesGET /v1/repos/:owner/:repo/branches查询 branches。
RepositoriesGET /v1/repos/:owner/:repo/issues查询 issues。
RepositoriesGET /v1/repos/:owner/:repo/issues/:number查询 issue 详情。
RepositoriesGET /v1/repos/:owner/:repo/issues/:number/comments查询 issue comments。
RepositoriesGET /v1/repos/:owner/:repo/references查询 issues、pull requests 或 merge requests。
RepositoriesGET /v1/repos/:owner/:repo/references/:number查询 reference 详情。
RepositoriesGET /v1/repos/:owner/:repo/references/:number/comments查询 reference comments。
RepositoriesGET /v1/repos/:owner/:repo/references/:number/inline-comments查询 inline comments。
RepositoriesGET /v1/repos/:owner/:repo/references/:number/activity查询 reference activity。
RepositoriesGET /v1/repos/:owner/:repo/references/:number/diff查询 reference diff。
Git integrationsGET /v1/git-servers查询可用 Git servers。
Git integrationsGET /v1/git-servers/:gitServerId查询 Git server 详情。
Git integrationsGET /v1/git-servers/:gitServerId/apps查询 Git server apps。
Git integrationsGET /v1/git-apps查询当前账户的 Git apps。
Git integrationsGET /v1/git-apps/:appId/repositories查询 Git app 下的 repositories。
FilesGET /v1/files查询当前账户的 files。
FilesGET /v1/files/:fileId获取可访问文件的下载跳转 URL。
ContactsGET /v1/contacts查询联系人。
ContactsGET /v1/contacts/candidates搜索可添加的联系人候选。
AgentsGET /v1/agents查询 agents。
AgentsGET /v1/agents/user/:userId查询指定用户发布的 agents。
AgentsGET /v1/user-agents查询当前账户的 agents 和 draft agents。
AgentsGET /v1/agents/:agentId查询 agent 详情。
AgentsGET /v1/agents/:agentId/git-url查询 published agent 的 Git URL。请按敏感信息处理。
HiveGET /v1/hive/me查询自己发布的 Hive listings。
HiveGET /v1/hive/installed查询自己安装的 Hive listings。

部分公开浏览接口不需要 API key,例如 GET /v1/resources、GET /v1/hive/listings、GET /v1/hive/listings/:id 和 GET /v1/hive/trending。

安全轮换 API Key​

  1. 创建一个命名清楚的新 key,比如 github-actions-agentrix。
  2. 更新 CI secret 或自动化环境变量。
  3. 运行一次自动化任务,确认新 key 可用。
  4. 从 Settings -> API Keys 删除旧 key。

agentrix-run 可以通过 AGENTRIX_API_KEY 或 GitHub Action 的 api-key input 传入 key。CI 示例见 agentrix-run。