获取 /api/v1/projects/{id}/execution-logs

通过工作区编排引擎获取会话的执行日志。项目范围由路由 ID 路径参数承载,而组织则派生自该项目。

路径参数

  • id 字符串 必需

    项目 ID

查询参数

  • session_id 字符串 必需

    会话id

  • since 字符串

    RFC3339 时间戳过滤

  • 之后 字符串

    不透明游标由上一个响应作为 next_cursor 返回

  • Workspace_id 字符串

    用于工作区解析的工作区ID

响应

  • 不支持或格式不正确的API版本、所选已发布合约中不可用的操作或不可接受的表示形式(包括不支持的媒体类型参数或排除的 SSE)。现有的身份验证、授权和速率限制失败优先。

    隐藏响应属性 显示响应属性 对象
    • badRequestDetail 对象

      标准错误模式定义的可选验证详细信息; API协商错误不会发出此字段。

      隐藏 BadRequestDetail 属性 显示 BadRequestDetail 属性 对象
      • 字段 大量[对象]

        验证失败的字段。

        隐藏字段属性 显示字段属性 对象

        字段及其验证失败。

        • 描述 字符串 必需

          人类可读的验证失败。

        • 字段 字符串 必需

          无效请求字段的名称或路径。

    • 详细信息 字符串 必需

      人类可读的错误详细信息。

    • 错误 整型 必需

      HTTP status code.

    • 错误代码 字符串 必需

      机器可读的错误代码。

    • 参数 array[string]

      与错误相关的请求参数名称;不应用时省略。

    • 原因 字符串 必需

      HTTP状态原因短语。

    隐藏响应属性 显示响应属性 对象
    • badRequestDetail 对象

      标准错误模式定义的可选验证详细信息; API协商错误不会发出此字段。

      隐藏 BadRequestDetail 属性 显示 BadRequestDetail 属性 对象
      • 字段 大量[对象]

        验证失败的字段。

        隐藏字段属性 显示字段属性 对象

        字段及其验证失败。

        • 描述 字符串 必需

          人类可读的验证失败。

        • 字段 字符串 必需

          无效请求字段的名称或路径。

    • 详细信息 字符串 必需

      人类可读的错误详细信息。

    • 错误 整型 必需

      HTTP status code.

    • 错误代码 字符串 必需

      机器可读的错误代码。

    • 参数 array[string]

      与错误相关的请求参数名称;不应用时省略。

    • 原因 字符串 必需

      HTTP状态原因短语。

  • 200

    正常

    隐藏响应属性 显示响应属性 对象
    • 数数 整型
    • has_more 布尔
    • logs 大量[对象]
      隐藏日志属性 显示日志属性 对象
      • a2a_caller_workspace_id 字符串
      • a2a_parent_execution_id 字符串
      • a2a_target_agent_id 字符串
      • a2a_target_agent_name 字符串
      • completion_tokens 整型
      • cost_usd 数字
      • 决定 字符串
      • duration_ms 数字
      • 错误 字符串
      • execution_id 字符串
      • guardrail_action 字符串

        Guardrail 决策字段(由 LogGuardrailDecision 为 Kind="guardrail" 日志填充)。这些是 OE文档的顶级字段;将它们映射到此处可确保API网关将它们传递到用户界面,而不是在结构解组期间删除它们。

      • guardrail_name 字符串
      • guardrail_type 字符串
      • id 字符串
      • 输入 对象

        允许使用其他属性。

      • kind 字符串

        类型为“llm”对于 LLM 调用,"tool"对于普通工具,“memory”为对于内存操作,“a2a”对于代理到代理的调用,"guardrail"用于“guardrail 决策事件”,以及“policy”用于平台策略决策事件。

        取值为 llm、tool、memory、a2a、guardrail 或 policy。

      • log_source 字符串

        LogSource 标识记录此日志行的平台组件(示例,“memory_proxy”表示由平台的内存代理写入的行)。对于从代理驱动的调用中记录的行,该行为空。

      • metadata 对象

        允许使用其他属性。

      • 模型 字符串
      • org_id 字符串
      • pod_name 字符串

        执行工具的主机名/pod 名称

      • PROJECT_ID 字符串
      • prompt_tokens 整型

        令牌使用情况和费用字段(为invoke_llm调用填充)

      • root_execution_id 字符串
      • root_session_id 字符串
      • session_id 字符串
      • span_id 字符串
      • 状态 字符串

        步骤结果;包括“canceled”用于调用者取消的内存轮次写入。

      • 步骤编号 整型

        StepNumber 标识其执行中的步骤。它将日志行与客户端在其他地方查看的步骤联系起来 — 此处省略它,该行仍然会到达,但无法说明它属于哪个步骤。

      • timestamp string(date-time)
      • 工具 字符串
      • tool_api_error 对象
        隐藏tool_api_error 属性 显示tool_api_error 属性 对象
        • 分类 字符串
        • error_code 字符串
        • http_status 整型
        • provider_type 字符串
        • 原因 字符串
        • 可重试 布尔

          如果新的提供商程序调用可能成功,则为 True (429/503/timeout/connect)。不得重放此工具调用。

      • tool_call_id 字符串

        ToolCallID 是稳定的 LLM 工具调用 ID。将工具调用的开始/结果执行日志记录相互连接并连接到会话消息。对于invoke_llm 和其他非工具调用事件,该事件为空。

      • total_tokens 整型
      • trace_id 字符串
      • Triggered_Policy_Ids array[string]
      • user_id 字符串
      • Workspace_id 字符串
    • next_cursor 字符串

      NextCursor 是下一次轮询的不透明后令牌。当 OE 未发送任何位置(首页为空)时被省略。

    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 数数 整型
    • has_more 布尔
    • logs 大量[对象]
      隐藏日志属性 显示日志属性 对象
      • a2a_caller_workspace_id 字符串
      • a2a_parent_execution_id 字符串
      • a2a_target_agent_id 字符串
      • a2a_target_agent_name 字符串
      • completion_tokens 整型
      • cost_usd 数字
      • 决定 字符串
      • duration_ms 数字
      • 错误 字符串
      • execution_id 字符串
      • guardrail_action 字符串

        Guardrail 决策字段(由 LogGuardrailDecision 为 Kind="guardrail" 日志填充)。这些是 OE文档的顶级字段;将它们映射到此处可确保API网关将它们传递到用户界面,而不是在结构解组期间删除它们。

      • guardrail_name 字符串
      • guardrail_type 字符串
      • id 字符串
      • 输入 对象

        允许使用其他属性。

      • kind 字符串

        类型为“llm”对于 LLM 调用,"tool"对于普通工具,“memory”为对于内存操作,“a2a”对于代理到代理的调用,"guardrail"用于“guardrail 决策事件”,以及“policy”用于平台策略决策事件。

        取值为 llm、tool、memory、a2a、guardrail 或 policy。

      • log_source 字符串

        LogSource 标识记录此日志行的平台组件(示例,“memory_proxy”表示由平台的内存代理写入的行)。对于从代理驱动的调用中记录的行,该行为空。

      • metadata 对象

        允许使用其他属性。

      • 模型 字符串
      • org_id 字符串
      • pod_name 字符串

        执行工具的主机名/pod 名称

      • PROJECT_ID 字符串
      • prompt_tokens 整型

        令牌使用情况和费用字段(为invoke_llm调用填充)

      • root_execution_id 字符串
      • root_session_id 字符串
      • session_id 字符串
      • span_id 字符串
      • 状态 字符串

        步骤结果;包括“canceled”用于调用者取消的内存轮次写入。

      • 步骤编号 整型

        StepNumber 标识其执行中的步骤。它将日志行与客户端在其他地方查看的步骤联系起来 — 此处省略它,该行仍然会到达,但无法说明它属于哪个步骤。

      • timestamp string(date-time)
      • 工具 字符串
      • tool_api_error 对象
        隐藏tool_api_error 属性 显示tool_api_error 属性 对象
        • 分类 字符串
        • error_code 字符串
        • http_status 整型
        • provider_type 字符串
        • 原因 字符串
        • 可重试 布尔

          如果新的提供商程序调用可能成功,则为 True (429/503/timeout/connect)。不得重放此工具调用。

      • tool_call_id 字符串

        ToolCallID 是稳定的 LLM 工具调用 ID。将工具调用的开始/结果执行日志记录相互连接并连接到会话消息。对于invoke_llm 和其他非工具调用事件,该事件为空。

      • total_tokens 整型
      • trace_id 字符串
      • Triggered_Policy_Ids array[string]
      • user_id 字符串
      • Workspace_id 字符串
    • next_cursor 字符串

      NextCursor 是下一次轮询的不透明后令牌。当 OE 未发送任何位置(首页为空)时被省略。

    • Success 布尔
  • Bad Request

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
  • Unauthorized

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
  • 第 425 章

    工作区编排引擎尚未准备就绪

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
  • 内部服务器错误

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
  • 错误网关

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
GET /api/v1/projects/{id}/execution-logs
curl \
 --request GET 'https://agentengine.mongodb.com/api/v1/projects/{id}/execution-logs?session_id=string' \
 --header "Authorization: $API_KEY"
响应示例 (406)
{
  "detail": "This operation is not available in API version 2026-09-20-preview.",
  "error": 406,
  "errorCode": "OPERATION_NOT_IN_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
{
  "detail": "This operation supports text/event-stream, which the Accept header excludes. Remove unsupported media-type parameters or accept this type with a positive q value.",
  "error": 406,
  "errorCode": "UNACCEPTABLE_MEDIA_TYPE",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
{
  "detail": "The requested API version is not supported. Supported versions: 2026-09-20-preview.",
  "error": 406,
  "errorCode": "UNSUPPORTED_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
响应示例 (406)
{
  "detail": "This operation is not available in API version 2026-09-20-preview.",
  "error": 406,
  "errorCode": "OPERATION_NOT_IN_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
响应示例 (200)
{
  "count": 42,
  "has_more": true,
  "logs": [
    {
      "a2a_caller_workspace_id": "string",
      "a2a_parent_execution_id": "string",
      "a2a_target_agent_id": "string",
      "a2a_target_agent_name": "string",
      "completion_tokens": 42,
      "cost_usd": 42.0,
      "decision": "string",
      "duration_ms": 42.0,
      "error": "string",
      "execution_id": "string",
      "guardrail_action": "string",
      "guardrail_name": "string",
      "guardrail_type": "string",
      "id": "string",
      "inputs": {},
      "kind": "llm",
      "log_source": "string",
      "metadata": {},
      "model": "string",
      "org_id": "string",
      "pod_name": "string",
      "project_id": "string",
      "prompt_tokens": 42,
      "root_execution_id": "string",
      "root_session_id": "string",
      "session_id": "string",
      "span_id": "string",
      "status": "string",
      "step_number": 42,
      "timestamp": "2026-05-04T09:42:00Z",
      "tool": "string",
      "tool_api_error": {
        "classification": "string",
        "error_code": "string",
        "http_status": 42,
        "provider_type": "string",
        "reason": "string",
        "retryable": true
      },
      "tool_call_id": "string",
      "total_tokens": 42,
      "trace_id": "string",
      "triggered_policy_ids": [
        "string"
      ],
      "user_id": "string",
      "workspace_id": "string"
    }
  ],
  "next_cursor": "string",
  "success": true
}
响应示例 (200)
{
  "count": 42,
  "has_more": true,
  "logs": [
    {
      "a2a_caller_workspace_id": "string",
      "a2a_parent_execution_id": "string",
      "a2a_target_agent_id": "string",
      "a2a_target_agent_name": "string",
      "completion_tokens": 42,
      "cost_usd": 42.0,
      "decision": "string",
      "duration_ms": 42.0,
      "error": "string",
      "execution_id": "string",
      "guardrail_action": "string",
      "guardrail_name": "string",
      "guardrail_type": "string",
      "id": "string",
      "inputs": {},
      "kind": "llm",
      "log_source": "string",
      "metadata": {},
      "model": "string",
      "org_id": "string",
      "pod_name": "string",
      "project_id": "string",
      "prompt_tokens": 42,
      "root_execution_id": "string",
      "root_session_id": "string",
      "session_id": "string",
      "span_id": "string",
      "status": "string",
      "step_number": 42,
      "timestamp": "2026-05-04T09:42:00Z",
      "tool": "string",
      "tool_api_error": {
        "classification": "string",
        "error_code": "string",
        "http_status": 42,
        "provider_type": "string",
        "reason": "string",
        "retryable": true
      },
      "tool_call_id": "string",
      "total_tokens": 42,
      "trace_id": "string",
      "triggered_policy_ids": [
        "string"
      ],
      "user_id": "string",
      "workspace_id": "string"
    }
  ],
  "next_cursor": "string",
  "success": true
}
响应示例 (400)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (400)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (401)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (401)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (425)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (425)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (500)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (500)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (502)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (502)
{
  "code": "string",
  "error": "string",
  "success": true
}