Create agent
Create agent and auto-create Virtual Key. Returns fullToken once. Owner or admin.
Headers
Authorization
Bearer {access_token}
X-Workspace-Id
Workspace UUID
Request
name, provider, and masterKeyId are required; model is optional
masterKeyId
name
provider
about
allowedModels
budget
budgetAction
budgetWindow
departmentId
description
environment
expiresAt
framework
linkedEndpointSlug
model
modelsInfo
ModelsInfo 是 custom provider 时的模型价格,格式:{“modelId”: {“prompt”: 1.5, “completion”: 2.0}} 单位:美元 / 1M tokens
rateLimitRpm
runtime
Required when source is n8n_workflow or custom_webhook. The runtimeType must match that source.
source
Agent source. n8n_workflow and custom_webhook require runtime.
Response
data: agent + virtualKey (id, keyPrefix, fullToken)
Errors
400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error