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

AgentKit

复制全文
下载 pdf
Sandbox Tool
SetSessionTtl - 配置会话实例存活时长
复制全文
下载 pdf
SetSessionTtl - 配置会话实例存活时长
配置会话实例的存活时长。​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:SetSessionTtl​
要执行的操作,取值:SetSessionTtl。​
​
Version string 必选 示例值:2025-10-30​
API的版本,取值:2025-10-30。​
​
SessionId string 必选 示例值:s-3tigy72q3u3vj0x2****​
会话ID。​
​
ToolId string 必选 示例值:t-3tigy72q3u3vj0x2****​
工具ID。​
​
Ttl integer 必选 示例值:1800​
会话实例存活时长,即工具在一次 “用户 - 工具交互会话” 中,保持用户状态、操作上下文不丢失的有效时长。会话过期后,只需重新登录或重启操作即可。​
  • 单位:秒。​
  • 取值范围:60~86400。​
  • 默认值为:1800。​
​
TtlUnit string 可选 示例值:second​
会话实例存活时长的单位,取值:​
  • minute:分。​
  • second(默认):秒。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
ExpireAt string 示例值:2006-01-02T15:04:05Z07:00​
会话过期时间。​
​
SessionId string 示例值:s-3tigy72q3u3vj0x2****​
会话ID。​
​
ToolId string 示例值:t-3tigy72q3u3vj0x2****​
工具ID。​
​
​
​
请求示例​
​
POST https://agentkit.cn-beijing.volcengineapi.com?Action=SetSessionTtl&Version=2025-10-30 HTTP/1.1​
Content-Type: application/json​
{​
"ToolId": "t-ye6xzwchkwoaroxxxxxx",​
"SessionId": "s-ye6xzwchkwoaroxxxxxx",​
"Ttl": 1800​
}​
​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20251027144356FBC64212879D5D3A****",​
"Action": "SetSessionTtl",​
"Version": "2025-10-30",​
"Service": "agentkit",​
"Region": "cn-beijing"​
},​
"Result": {​
"SessionId": "s-ye7sfdm2o0c1kdto****"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
MissingParameter.SessionId​
The required parameter SessionId is not supplied.​
SessionId不能为空。​
400​
MissingParameter.ToolId​
The required parameter ToolId is not supplied.​
ToolId不能为空。​
400​
MissingParameter.Ttl​
The required parameter Ttl is not supplied.​
参数Ttl不能为空。​
400​
InvalidParameter.Ttl​
The specified parameter Ttl is invalid.​
参数Ttl不能为空。​
404​
InvalidResource.NotFound​
The specified resource does not exist.​
指定资源不存在。​
​
​
最近更新时间:2025.12.26 17:38:24
这个页面对您有帮助吗?
有用
有用
无用
无用