API 参考 / admin
PUT /api/v1/admin/settings/llm · adminUpdateLLMSettings
覆盖 LLM 配置(endpoint / apiKey / model / 推理参数 / 成本单价)。apiKey 留空表示保留已存 key; key 明文存控制面库、GET 永不回显。保存前会用候选配置跑一次最小连通性探活(一次最小 chat completion),探活不通过直接 422 拒绝保存——LLM 配错会让生成静默走错误目标或外发到错误端点。 endpoint 必须 https + 域名(非 IP),SSRF 实际防护在适配器受限 dialer。全部留空 = 停用 LLM, 跳过探活直接保存。保存后下次 worker 启动生效(本期不做热切换)。写审计 platform.config.update (metadata 不含 apiKey)。要求平台超管。
本接口要求浏览器会话。Bearer API Token 无法调用——Token 的生命周期管理必须在网页端完成。
endpoint(必填)model(必填)apiKeytemperature(必填)maxTokens(必填)promptCostPer1M(必填)completionCostPer1M(必填)currency(必填)endpoint(必填)model(必填)temperature(必填)maxTokens(必填)promptCostPer1M(必填)completionCostPer1M(必填)currency(必填)apiKeyConfigured(必填)configured(必填)401:Problem 错误响应403:Problem 错误响应422:Problem 错误响应curl -X PUT "https://你的项目.workflow.games/api/v1/admin/settings/llm" \
-H "Authorization: Bearer wfp_…" \
-H "content-type: application/json" \
--data '{"endpoint":"示例文本","model":"示例文本","temperature":1,"maxTokens":1,"promptCostPer1M":1,"completionCostPer1M":1,"currency":"示例文本"}'HTTP/1.1 200
{
"endpoint": "示例文本",
"model": "示例文本",
"temperature": 1,
"maxTokens": 1,
"promptCostPer1M": 1,
"completionCostPer1M": 1,
"currency": "示例文本",
"apiKeyConfigured": true,
"configured": true
}合同真值:OpenAPI 3.1(0.1.0)。
相关:Agent 接入指南 · 使用指南 · API 参考索引