---
title: "生成或获取 Provider 的 Agent 密钥"
method: POST
path: "/v1/admin/providers/{id}/agent-secret"
tags: ["admin/providers"]
---

# 生成或获取 Provider 的 Agent 密钥

`POST /v1/admin/providers/{id}/agent-secret`

为 agent 连接模式的 Provider 生成新的鉴权密钥（仅首次），后续调用只返回已有密钥。密钥一旦创建即写死，需删除Provider重建才能刷新。

## Path parameters

- `id` integer, required

## Changes

- **2026-05-18** `24cddb042691` — 1 info
  - endpoint added
- **2025-10-22** `dcdf027169a3` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/oneclickvirt/apis/oneclickvirt-api/changes/v1/admin/providers/:id/agent-secret/post.md)

---

[API](https://skmtc.dev/oneclickvirt/apis/oneclickvirt-api.md) · [All operations](https://skmtc.dev/oneclickvirt/apis/oneclickvirt-api/llms.txt) · [OpenAPI document](https://skmtc.dev/oneclickvirt/apis/oneclickvirt-api/revisions/5d38e17cc07e?raw)
