Invoke

执行一次 Agent 工具调用(需要 skill_key 鉴权,调用成功即扣费)。

参数: body: tool(工具名)、params(工具参数)、session_id(可选,仅用于日志串联)。 background_tasks: 用于在响应返回后异步写调用日志,不阻塞用户。

返回: AgentInvokeResponse(code=200, tool, data, credits_used)。

异常(均为 ApiException,由全局处理器转成统一错误体): 404 40420 功能未开启;404 40421 工具不存在;400 40021 必填参数缺失; 403 40321 被风控拦截;429/503 限流相关(见 _check_limits); 402 40201 余额不足;502 50201 上游异常(且已退款)。

post/api/v1/agent/invoke

Request

  • Base URL: https://api.twtapi.com (the document declares no server; this is the origin it was published from)
  • URL: https://api.twtapi.com/api/v1/agent/invoke
  • Auth: none declared

Request body

toolstring required
paramsobject
session_idstring nullable

Response

Successful Response

codeinteger
toolstring required
dataunknown
credits_usednumber required

Changes

No recorded changes to this operation across all 2 revisions of this API.