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

AgentKit

复制全文
下载 pdf
Runtime
CreateRuntime - 创建一个运行时
复制全文
下载 pdf
CreateRuntime - 创建一个运行时
创建一个运行时(Runtime),操作说明和注意事项请参见创建Runtime。​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:CreateRuntime​
要执行的操作,取值:CreateRuntime。​
​
Version string 必选 示例值:2025-10-30​
API的版本,取值:2025-10-30。​
​
AgentSpaceId string 可选 示例值:as-yeh6q4a48****​
关联A2A智能体空间ID。​
​
ApmplusEnable boolean 可选 示例值:true​
是否开启APMPlus和日志服务,以提供对Runtime的监控并写入日志。取值:​
  • true(默认):开启。​
  • false:不开启。​
​
ArtifactType string 必选 示例值:image​
镜像类型。取值:​
  • image: 自定义镜像。​
  • public_image: 公共镜像。​
​
ArtifactUrl string 必选 示例值:cp-enterprise-cn-beijing.cr.volces.com/demo/agent:latest​
镜像URL。​
  • 格式为host/namespace/repo:tag的镜像地址。​
  • 当镜像类型选择公共镜像时,镜像地址请输入agentkit-prod-public-cn-beijing.cr.volces.com/template/financial:v1117_1。​
​
AuthorizerConfiguration.CustomJwtAuthorizer.DiscoveryUrl string 必选 示例值:https://example.com/.well-known/openid-configuration​
使用OAuth JWT进行入站身份认证鉴权时,令牌签名密钥URL。​
此URL用于获取OpenID Connect配置或授权服务器元数据,以验证传入的令牌。目前仅支持火山引擎Identity服务的签名秘钥URL。​
说明​
携带KeyAuth和CustomJwtAuthorizer的参数,必须传入其中一组。​
​
AuthorizerConfiguration.CustomJwtAuthorizer.AllowedClients.N string[] 可选 示例值:["client1”, "client2"]​
使用OAuth JWT进行入站身份认证鉴权时,允许访问的客户端列表。如果允许所有客户端,则置为空列表。​
说明​
携带KeyAuth和CustomJwtAuthorizer的参数,必须传入其中一组。​
​
AuthorizerConfiguration.KeyAuth.ApiKeyLocation string 可选 示例值:Header​
使用API Key进行入站身份认证鉴权时,API Key传递的位置。​
  • Header:当前仅支持Header。​
说明​
携带KeyAuth和CustomJwtAuthorizer的参数,必须传入其中一组。​
​
AuthorizerConfiguration.KeyAuth.ApiKeyName string 可选 示例值:test-key​
使用API Key进行入站身份认证鉴权时,API Key的名字。取值:​
  • 传入本参数时不能为空,长度为4 ~ 64的字符串。​
  • 由字母、数字、“-”和“_”组成​
说明​
携带KeyAuth和CustomJwtAuthorizer的参数,必须传入其中一组。​
​
ClientToken string 可选 示例值:23fa21A8823nfasd7f****​
保证请求幂等性。由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。​
取值:仅支持ASCII字符,且不能超过64个字符。​
​
CpuMilli integer 可选 示例值:2000​
实例vCPU规格, 单位为milli cpu。​
  • 取值范围 250~16000。​
  • 默认值为2000。​
​
Description string 可选 示例值:Agent-001​
运行时描述。​
  • 长度限制为 1000 以内的 Unicode 字符。​
  • 不填默认为空。​
​
Envs.N.Key string[] 必选 示例值:DATABASE_MEM0_BASE_URL​
运行时环境变量的键。​
  • 只能包含字母、数字、下划线,且只能以下划线字母开头, 长度限制为1 ~ 63个字符。​
  • 同一运行时下 Key 唯一。​
​
Envs.N.Value string[] 可选 示例值:mem0-cnlfjzigaku8gc****.mem0.volces.com:8000​
运行时环境变量的值。​
​
KnowledgeId string 可选 示例值:kb-ye9g****​
关联的知识库ID。​
​
LlmshieldAppId string 可选 示例值:app-d65v55avi7p8hpl3****​
大模型应用防火墙资产ID。​
​
MCPToolsetId string 可选 示例值:mt-3tigy72q3u3vj0x2****​
关联MCP工具集ID。​
​
MaxConcurrency integer 可选 示例值:100​
实例最大并发请求数量。​
  • 取值范围:10~1000。​
  • 默认值:100。​
​
MaxInstance integer 可选 示例值:10​
最大实例数量。​
  • 取值范围:1~10。​
  • 默认值为10。​
说明​
如需提升最大实例数上限,请前往配额中心申请提升Runtime/Instances配额上限。​
​
MemoryId string 可选 示例值:mem-1763997****​
关联的记忆库ID。​
​
MemoryMb integer 可选 示例值:2048​
实例Memory规格。单位:MiB。​
  • 取值范围:512~131072。​
  • 默认值:4096。​
说明​
取值需要以 512 为梯度,即512、1024、1536、2048等。​
​
MinInstance integer 可选 示例值:1​
最小实例数量。​
  • 取值范围:0~MaxInstance。​
  • 默认值:0。​
​
ModelAgentName string 可选 示例值:doubao-seed-1.6​
推理模型接入点。​
​
Name string 必选 示例值:test-runtime​
运行时名称。​
  • 长度为4 ~ 64的字符串。​
  • 由字母、数字、“-”和“_”组成。​
​
NetworkConfiguration.EnablePrivateNetwork boolean 可选 示例值:true​
是否开启运行时的私网访问能力,取值:​
  • true:开启。​
  • false(默认):不开启。​
说明​
EnablePrivateNetwork和EnablePublicNetwork参数,必须传入其中一个。​
​
NetworkConfiguration.EnablePublicNetwork boolean 可选 示例值:true​
是否开启运行时的公网访问能力,取值:​
  • true(默认):开启。​
  • false:不开启。​
说明​
EnablePrivateNetwork和EnablePublicNetwork参数,必须传入其中一个。​
​
NetworkConfiguration.VpcConfiguration.VpcId string 必选 示例值:vpc-257gqcdfvx6n****​
私有网络ID。​
说明​
当NetworkConfiguration.EnablePrivateNetwork取值为ture时必选。​
​
NetworkConfiguration.VpcConfiguration.EnableSharedInternetAccess boolean 可选 示例值:true​
公网出口配置。取值:​
  • ture(默认):开启,表示运行时将使用平台提供的公网出口访问公网。​
  • false:未开启,表示运行时将使用私有网络中已配置的公网NAT网关出口访问公网。​
说明​
仅当NetworkConfiguration.EnablePrivateNetwork配置为true时有效。​
​
NetworkConfiguration.VpcConfiguration.SubnetIds.N string[] 可选 示例值:["subnet-1234567890"]​
子网ID列表,每个可用区只能指定一个子网ID。​
说明​
当EnablePrivateNetwork取值为ture时必选。​
​
ProjectName string 可选 示例值:default​
所属项目名称。​
​
RoleName string 必选 示例值:AgentKit_Runtime_Default_ServiceRole_****​
运行时绑定的IAM角色名称。​
​
RequestModifierConfig.FunctionId string 可选 示例值:fn-2abcxxxx​
veFaaS函数ID。您可以调用GetFunction获取函数ID。​
​
SessionStoreId string 可选 示例值:ss-yefjbwgpa8c1kdto****​
关联的会话资源ID。​
​
RequestModifierConfig.Path string 可选 示例值:/hello​
自行定义访问 HTTP 服务器的路径。用于指定请求修改器作用的请求路径。​
​
Tags.N.Key string[] 必选 示例值:Tags.1.Key=k1​
为资源添加的标签的标签键。​
  • 参数 - N:表示标签键的序号,取值范围:1~20。​
  • 多个标签键之间用&分隔。​
命名规则如下:​
  • 不能以任何大小写形式的volc:或sys:开头。​
volc:或sys:开头为系统预留标签键禁止创建。​
  • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。​
  • 长度限制在1~128个字符之间。​
​
Tags.N.Type string[] 可选 示例值:custom​
为资源添加的标签类型。​
  • system:系统标签。​
  • custom:用户标签。​
​
Tags.N.Value string[] 可选 示例值:Tags.1.Value=v1​
为资源添加的标签的标签值。​
  • 参数 - N:表示标签值的序号,取值范围:1~20。​
  • 多个标签值之间用&分隔。​
命名规则如下:​
  • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。​
  • 允许为空,长度限制在0~256个字符之间。​
​
ToolId string 可选 示例值:t-dascxxxxx​
关联的工具ID。​
​
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时必填。​
​
GatewayMode string 可选 示例值:Shared​
网关模式。取值:​
  • Shared(默认):共享网关。​
  • Exclusive:专属网关。​
​
GatewayInstanceId string 可选 示例值:g-dab8me4bbg9nb6j6****​
专属网关实例ID。​
说明​
当GatewayMode配置为 Exclusive 时必填。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
RuntimeId string 示例值:r-ye7agye1a8cr38iu****​
运行时ID。​
​
​
​
请求示例​
​
POST https://agentkit.cn-beijing.volcengineapi.com?Action=CreateRuntime&Version=2025-10-30 HTTP/1.1​
Content-Type: application/json​
{​
"Name": "my-126663mx9****",​
"ArtifactType": "image",​
"ArtifactUrl": "agentkit-center-test-cn-beijing.cr.volces.com/agentkit/simple-app:1.0",​
"RoleName": "TestRoleForAgentKit",​
"AuthorizerConfiguration": {​
"KeyAuth": {​
"ApiKeyName": "xxi4256666623****",​
"ApiKeyLocation": "Header"​
}​
},​
"Envs": [​
{​
"Key": "MODEL_AGENT_API_KEY",​
"Value": "38484cc0-29ab-****-99b1-*****"​
},​
{​
"Key": "OBSERVABILITY_OPENTELEMETRY_APMPLUS_API_KEY",​
"Value": "78ed39eee6fa12824042a6b2359****"​
},​
{​
"Key": "OBSERVABILITY_OPENTELEMETRY_APMPLUS_ENDPOINT",​
"Value": "http://apmplus-cn-beijing.volces.com:4317"​
},​
{​
"Key": "OBSERVABILITY_OPENTELEMETRY_APMPLUS_SERVICE_NAME",​
"Value": "veadk_tracing"​
}​
],​
"ApmplusEnable": true​
}​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "202106111445100102252431000052****",​
"Action": "CreateRuntime",​
"Version": "2025-10-30",​
"Service": "agentkit",​
"Region": "cn-beijing"​
},​
"Result": {​
"RuntimeId": " r-3thhlu***"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
InvalidDescription.Malformed​
The specified Description is malformed.​
指定的描述格式错误。​
400​
InvalidKey.Malformed​
The specified Key is malformed.​
指定的Key不合法。​
400​
InvalidName.Malformed​
The specified Name is malformed.​
指定的Name不合法。​
400​
InvalidParameter.ArtifactType​
The specified ArtifactType is invalid.​
ArtifactType参数不合法。​
400​
InvalidParameter.ArtifactUrl​
The specified parameter ArtifactUrl is invalid.​
指定的ArtifactUrl无效。​
400​
InvalidParameter.ConflictingAuthorizerConfiguration​
The AuthorizerConfiguration contains conflicting configurations.​
AuthorizerConfiguration参数不合法。​
400​
InvalidParams.MaxConcurrency​
MaxConcurrency should be in range [10, 1000]​
MaxConcurrency不合法,需要在[10, 1000]范围内。​
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.ArtifactType​
The required parameter ArtifactType is not supplied.​
agent代码产物类型不能为空。​
400​
MissingParameter.ArtifactUrl​
The required parameter ArtifactUrl is not supplied.​
agent代码产物地址不能为空。​
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.NetworkConfiguration​
The required parameter NetworkConfiguration is not supplied.​
参数NetworkConfiguration不能为空。​
400​
MissingParameter.RoleName​
The required parameter RoleName is not supplied.​
参数RoleName不能为空。​
400​
MissingParameter.VpcId​
The required parameter VpcId is not supplied.​
参数VpcId不能为空。​
400​
QuotaExceeded.Runtime​
You've reached the limit on the number of runtime that you can create, please submit ticket or sign-on to the Console to request an increase in [runtime] quota.​
运行时配额超限。​
403​
AccessDenied.Unauthorized​
The specified action on the resource is denied.​
指定的操作被拒绝。角色权限不足。​
409​
InvalidParameter.DuplicateName​
The specified name already exists.​
名称已存在。​
​
​
最近更新时间:2026.09.09 14:26:23
这个页面对您有帮助吗?
有用
有用
无用
无用