Create agent

以 Markdown 格式查看

Create agent and auto-create Virtual Key. Returns fullToken once. Owner or admin.

请求头

Authorizationstring必需

Bearer {access_token}

X-Workspace-Idstring必需
Workspace UUID

请求

name, provider, and masterKeyId are required; model is optional

masterKeyIdstring必需
namestring必需
providerstring必需
aboutstring可选
allowedModelslist of strings可选
budgetdouble可选
budgetActionstring可选
budgetWindowstring可选
departmentIdstring可选
descriptionstring可选
environmentstring可选
expiresAtstring可选
frameworkstring可选
linkedEndpointSlugstring可选
modelstring可选
modelsInfomap from strings to objects可选

ModelsInfo 是 custom provider 时的模型价格,格式:{“modelId”: {“prompt”: 1.5, “completion”: 2.0}} 单位:美元 / 1M tokens

rateLimitRpminteger可选
runtimeobject可选

Required when source is n8n_workflow or custom_webhook. The runtimeType must match that source.

sourceenum可选默认为 manual

Agent source. n8n_workflow and custom_webhook require runtime.

响应

data: agent + virtualKey (id, keyPrefix, fullToken)

错误

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error