You need to enable JavaScript to run this app.
文档中心
AgentKit

AgentKit

复制全文
下载 pdf
Sandbox Tool
CreateTool - 创建沙箱工具
复制全文
下载 pdf
CreateTool - 创建沙箱工具
创建沙箱工具,操作说明和注意事项请参见创建沙箱工具。​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:CreateTool​
要执行的操作,取值:CreateTool。​
​
Version string 必选 示例值:2025-10-30​
API的版本,取值:2025-10-30。​
​
AuthorizerConfiguration.KeyAuth.ApiKey string 可选 示例值:22243eefff**​
使用API Key进行入站身份认证鉴权时,API Key的值。允许为空,留空默认随机生成一个字符串。 用户访问运行时需要携带这个Key。​
​
ApmplusEnable boolean 可选 示例值:true​
是否开启日志服务。取值:​
  • true(默认):开启。​
  • false:未开启。​
​
Description string 可选 示例值:this is a tool​
工具的描述信息,取值:​
  • 长度限制为 200 以内的 Unicode 字符。​
  • 不填默认为空。​
​
AuthorizerConfiguration.KeyAuth.ApiKeyLocation string 可选 示例值:Header​
使用API Key进行入站身份认证鉴权时,API Key传递的位置。​
  • Header:当前仅支持Header。​
​
Name string 必选 示例值:tool-test​
工具的名称,取值:​
  • 支持大小写英文字母、数字、中划线(-)、下划线(_)。​
  • 长度限制为4 ~ 64个字符。​
​
AuthorizerConfiguration.KeyAuth.ApiKeyName string 可选 示例值:test-key​
使用API Key进行入站身份认证鉴权时,API Key的名字。取值:​
  • 传入本参数时不能为空,长度为4 ~ 64的字符串。​
  • 由字母、数字、“-”和“_”组成。​
​
ToolType string 必选 示例值:All-in-one​
工具类型。取值:​
  • All-in-one:一体化工具集,即预置工具AIO Sandbox。​
  • Skill: Skill工具镜像,即预置工具Skills Sandbox。​
  • Private: 自定义工具。​
  • CodeEnv:预置工具Code Sandbox。​
​
Command string 可选 示例值:./run.sh​
工具启动命令。​
说明​
当ToolType取值为自定义工具时需传入,默认值为./run.sh。​
​
NetworkConfiguration.EnablePrivateNetwork boolean 可选 示例值:false​
是否开启工具的私网访问能力,取值:​
  • true:开启。​
  • false(默认):不开启。​
说明​
EnablePrivateNetwork和EnablePublicNetwork参数,必须传入其中一个。​
​
CpuMilli integer 可选 示例值:2000​
实例vCPU规格, 单位为milli cpu。​
  • All-in-one和Skill:2000​
​
NetworkConfiguration.EnablePublicNetwork boolean 可选 示例值:true​
是否开启工具的公网访问能力,取值:​
  • true:开启。​
  • false(默认):不开启。​
说明​
EnablePrivateNetwork和EnablePublicNetwork参数,必须传入其中一个。​
​
Envs.N.Key string[] 必选 示例值:Envs.1.Key=k1​
工具环境变量的键。​
  • 参数 - N:表示环境变量的序号,取值1~30。​
  • 取值:只能包含字母、数字、下划线,且只能以下划线字母开头, 长度限制为1 ~ 63个字符。​
​
NetworkConfiguration.VpcConfiguration.VpcId string 必选 示例值:vpc-257gqcdfvx6n****​
私有网络ID。​
说明​
当NetworkConfiguration.EnablePrivateNetwork取值为ture时必选。​
​
Envs.N.Value string[] 可选 示例值:Envs.1.Value=v1​
工具环境变量的值。​
  • 参数 - N:表示环境变量的序号,取值1~30。​
​
NetworkConfiguration.VpcConfiguration.SecurityGroupIds.N string[] 可选 示例值:SecurityGroupIds.1=sg-w08tvkc3e****​
安全组ID列表。​
说明​
当EnablePrivateNetwork取值为ture时必选。​
​
ImageUrl string 可选 示例值:http://***​
工具镜像地址。​
说明​
当ToolType取值为自定义工具时必填。​
​
EnableSnapshot boolean 可选 示例值:true​
是否在实例过期前自动创建快照。​
  • true:创建。​
  • false(默认):不创建。​
​
NetworkConfiguration.VpcConfiguration.SubnetIds.N string[] 可选 示例值:SubnetIds.1=subnet-ye7s6jatq8rxg218****​
子网ID列表,每个可用区只能指定一个子网ID。​
  • 参数 N:取值1 ~ 5。​
说明​
当EnablePrivateNetwork取值为ture时必选。​
​
ProjectName string 可选 示例值:default​
所属项目名称。​
​
MemoryMb integer 可选 示例值:550​
实例Memory规格。单位:MiB。取值范围:512~131072。​
​
RoleName string 可选 示例值:AgentKit-Runtime-Default-ServiceRole-xbv8s36​
工具绑定的IAM角色名称。​
​
ModelAgentName string 可选 示例值:doubao-seed-1.6​
推理模型接入点。​
​
Tags.N.Key string[] 必选 示例值:Tags.1.Key=k1​
为资源添加的标签的标签键。​
  • 参数 - N:表示标签键的序号,取值范围:1~20。​
  • 多个标签键之间用&分隔。​
命名规则如下:​
  • 不能以任何大小写形式的volc:或sys:开头。​
volc:或sys:开头为系统预留标签键禁止创建。​
  • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。​
  • 长度限制在1~128个字符之间。​
​
Tags.N.Value string[] 可选 示例值:Tags.1.Value=v1​
为资源添加的标签的标签值。​
  • 参数 - N:表示标签值的序号,取值范围:1~20。​
  • 多个标签值之间用&分隔。​
命名规则如下:​
  • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。​
  • 允许为空,长度限制在0~256个字符之间。​
​
NetworkConfiguration.VpcConfiguration.EnableSharedInternetAccess boolean 可选 示例值:true​
公网出口配置。取值:​
  • ture(默认):开启,表示工具将使用平台提供的公网出口访问公网。​
  • false:未开启,表示工具将使用私有网络中已配置的公网NAT网关出口访问公网。​
说明​
仅当NetworkConfiguration.EnablePrivateNetwork配置为true时有效。​
​
Port integer 可选 示例值:8000​
工具监听端口。​
说明​
当ToolType取值为自定义工具时需传入,默认值为8000。​
​
SkillSpaceId string 可选 示例值:ss-yedd6rcsu8****​
Skills空间的ID。​
​
Tags.N.Type string[] 可选 示例值:system​
标签类型。​
  • system:系统标签。​
  • custom:用户标签。​
​
TosMountConfig.Credentials.AccessKeyId string 可选 示例值:GY2OGJiOTdl****​
输入平台的Access Key ID。​
说明​
当TosMountConfig.EnableTos配置为true时必填。​
​
TosMountConfig.Credentials.SecretAccessKey string 可选 示例值:emRoTnpVNU5HU****​
输入平台的Secret Access Key ID。​
说明​
当TosMountConfig.EnableTos配置为true时必填。​
​
TosMountConfig.EnableTos boolean 可选 示例值:false​
是否启用TOS挂载。挂载后,工具实例对应目录产生的数据将存储至TOS服务。取值:​
  • true:开启。​
  • false(默认):不开启。​
​
TosMountConfig.MountPoints.N.BucketName string[] 可选 示例值:bucket01​
TOS存储桶名称。​
说明​
当TosMountConfig.EnableTos配置为true时必填。​
​
TosMountConfig.MountPoints.N.BucketPath string[] 可选 示例值:http://tos-cn-beijing.ivolces.com​
TOS存储桶路径。​
说明​
当TosMountConfig.EnableTos配置为true时必填。​
​
TosMountConfig.MountPoints.N.Endpoint string[] 可选 示例值:tmp/abc​
TOS存储桶子目录。​
说明​
当TosMountConfig.EnableTos配置为true时必填。​
​
TosMountConfig.MountPoints.N.LocalMountPath string[] 可选 示例值:/home/app​
待挂载的工具实例本地目录。​
说明​
当TosMountConfig.EnableTos配置为true时必填。​
​
TosMountConfig.MountPoints.N.ReadOnly boolean[] 可选 示例值:false​
指定待挂载的工具实例本地目录的访问权限。取值:​
  • true:只读权限。​
  • false(默认):读写权限。​
说明​
当TosMountConfig.EnableTos配置为true时必填。​
​
UseCodingPlan boolean 可选 示例值:false​
是否使用CodingPlan。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
ToolId string 示例值:t-3tigy72q3u3vj0x2****​
工具ID。​
​
​
​
请求示例​
​
POST https://agentkit.cn-beijing.volcengineapi.com?Action=CreateTool&Version=2025-10-30 HTTP/1.1​
Content-Type: application/json​
{ ​
"ToolType": "All-in-one", ​
"Name": "test-tool", ​
"AuthorizerConfiguration": { ​
"KeyAuth": { ​
"ApiKeyName": "test-api-key" ​
} ​
}, ​
"NetworkConfiguration": { ​
"EnablePublicNetwork": true, ​
"EnablePrivateNetwork": false ​
} ​
}​
​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "202106111445100102252431000052****",​
"Action": "CreateTool",​
"Version": "2025-10-30",​
"Service": "agentkit",​
"Region": "cn-beijing"​
},​
"Result": {​
"ToolId": "t-ye7hr4n01so****"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
InvalidDescription.Malformed​
The specified Description is malformed.​
指定的描述格式错误。​
400​
InvalidKey.Malformed​
The specified Key is malformed.​
指定的Key不合法。​
400​
InvalidModelAgentName.Malformed​
The specified ModelAgentName is malformed.​
指定的ModelAgentName不合法。​
400​
InvalidName.Malformed​
The specified Name is malformed.​
指定的Name不合法。​
400​
LimitExceeded.MaximumSubnetIds​
The number of specified SubnetIds exceeds the maximum limit.​
指定的SubnetIds超过最大限制。​
400​
LimitExceeded.MinimumSubnetIds​
The number of specified SubnetIds exceeds the minimum limit.​
指定的SubnetIds超过最小限制。​
400​
MissingParameter.AuthorizerConfiguration​
The required parameter AuthorizerConfiguration is not supplied.​
参数AuthorizerConfiguration不能为空。​
400​
MissingParameter.DiscoveryUrl​
The required parameter DiscoveryUrl is not supplied.​
参数DiscoveryUrl不能为空。​
400​
MissingParameter.EnableLog​
The required parameter EnableLog is not supplied.​
参数EnableLog不能为空。​
400​
MissingParameter.Key​
The required parameter Key is not supplied.​
参数Key不能为空。​
400​
MissingParameter.Name​
The required parameter Name is not supplied.​
名称不能为空。​
400​
MissingParameter.Value​
The required parameter Value is not supplied.​
参数Value不能为空。​
400​
MissingParameter.NetworkConfiguration​
The required parameter NetworkConfiguration is not supplied.​
参数NetworkConfiguration不能为空。​
400​
MissingParameter.ToolType​
The required parameter ToolType is not supplied.​
参数ToolType不能为空。​
400​
MissingParameter.VpcId​
The required parameter VpcId is not supplied.​
参数VpcId不能为空。​
400​
MissingParameter.NetworkType​
The required parameter NetworkType is not supplied.​
参数NetworkType不能为空。​
400​
MissingParameter.ApiKeyName​
The required parameter ApiKeyName is not supplied.​
参数ApiKeyName不能为空。​
400​
InvalidParameter.VpcConfiguration​
The specified VPC configuration is invalid.​
指定的VPC配置无效。​
400​
InvalidParameter.ToolType​
The specified ToolType is invalid.​
指定的ToolType无效。​
400​
InvalidParameter.NetworkConfiguration​
The specified NetworkConfiguration is invalid.​
指定的网络配置无效。​
400​
InvalidApiKeyLocation.Malformed​
The specified ApiKeyLocation is malformed.​
指定的ApiKeyLocation格式错误。​
400​
MissingParameter.Command​
The required parameter Command is not supplied.​
参数Command不能为空。​
400​
InvalidParameter.Port​
The specified Port is invalid.​
指定的Port不合法。​
400​
InvalidEnvKey.Malformed​
The environment variable key must start with an underscore or a letter, contain only letters, digits, or underscores, and be at most 63 characters long.​
指定的Env Key不合法。​
400​
MissingParameter.Port​
The required parameter Port is not supplied.​
参数Port不能为空。​
400​
MissingParameter.ImageUrl​
The required parameter ImageUrl is not supplied.​
参数ImageUrl不能为空。​
409​
InvalidParameter.DuplicateName​
The specified name already exists.​
指定的名称已存在。​
500​
InternalError​
An internal error has occurred.​
内部错误。​
​
​
最近更新时间:2026.07.21 19:16:36
这个页面对您有帮助吗?
有用
有用
无用
无用