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, model, masterKeyId (required)

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

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

rateLimitRpminteger可选

响应

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