---
title: "推理接口"
method: POST
path: "/llm-application/open/v3/application/invoke"
tags: ["智能体 API（旧）"]
deprecated: true
---

# 推理接口

`POST /llm-application/open/v3/application/invoke`

## Request

- Base URL: `https://open.bigmodel.cn/api`
- URL: `https://open.bigmodel.cn/api/llm-application/open/v3/application/invoke`
- Auth: HTTP bearer

> **Deprecated.**

对话型或文本型应用推理接口，支持同步和流式`SSE`调用。点击 **Try it** 按钮可快速试用。

## Request body

- ApplicationInvokeRequest
  - `app_id` string, required: 应用id
  - `conversation_id` string: 会话id, 未传则默认创建新会话
  - `third_request_id` string: 三方请求id(调用插件时传入, 用于链路排查问题)
  - `stream` boolean: 默认true，false时为同步调用
  - `messages` ApplicationInvokeMessage[], required: 用户输入列表
    - `role` string: 角色 user/assistant
    - `content` ApplicationInvokeContent[], required: 具体内容
      - `type` string, required: 内容类型 input/upload_file/upload_image/upload_video/selection_list
      - `value` string, required: 用户输入/下拉选项/文件ID/图片视频url
      - `key` string: 字段名称(文本类应用请求时必须传该字段)
  - `role` string: 对话类应用请求必传：user（用户输入）， assistant（模型返回）
  - `send_log_event` boolean: 是否实时推送过程日志，默认false

## Response `200`

请求成功

- ApplicationInvokeResponse
  - `request_id` string: 请求id
  - `conversation_id` string: 会话id
  - `app_id` string: 应用id
  - `choices` ApplicationInvokeChoice[]: 增量返回的信息
    - `index` integer: 结果下标
    - `finish_reason` string: stop: 正常结束 error: 执行失败
    - `error_msg` object: 异常信息
      - `code` integer
      - `msg` string
    - `delta` ApplicationInvokeDelta
      - `content` MessageData
        - `msg` string: 推理内容/文本/图片/视频/工具等
        - `type` string: text/image/video/all_tools
        - `code` string: 代码（all_tools时）
        - `file` string: 文件URL（all_tools时）
        - `url` string: 图片/视频url
        - `coverUrl` string: 视频封面url
      - `event` ApplicationInvokeEvent
        - `node_id` string: 节点id
        - `node_name` string: 节点名称
        - `type` string: 事件类型 node_processing/tool_processing/tool_finish/node_finish
        - `content` string: 输入输出内容
        - `time` integer: 毫秒
        - `tool_calls` ToolCallsData
          - `type` string: function/retrieval/web_search
          - `tool_calls_data` object: 工具消息体/日志体
      - `tool_calls` ToolCallsData
        - `type` string: function/retrieval/web_search
        - `tool_calls_data` object: 工具消息体/日志体
    - `messages` ApplicationInvokeMessages
      - `content` MessageData
        - `msg` string: 推理内容/文本/图片/视频/工具等
        - `type` string: text/image/video/all_tools
        - `code` string: 代码（all_tools时）
        - `file` string: 文件URL（all_tools时）
        - `url` string: 图片/视频url
        - `coverUrl` string: 视频封面url
      - `event` ApplicationInvokeEvent[]
        - `node_id` string: 节点id
        - `node_name` string: 节点名称
        - `type` string: 事件类型 node_processing/tool_processing/tool_finish/node_finish
        - `content` string: 输入输出内容
        - `time` integer: 毫秒
        - `tool_calls` ToolCallsData
          - `type` string: function/retrieval/web_search
          - `tool_calls_data` object: 工具消息体/日志体
  - `usage` ApplicationInvokeUsage[]: 本次调用的 tokens 数量统计
    - `model` string: 推理model
    - `nodeName` string: 节点名称
    - `inputTokenCount` integer: 输入的 tokens 数量
    - `outputTokenCount` integer: 输出的 tokens 数量
    - `totalTokenCount` integer: 总 tokens 数量

## Other responses

- `default`: 请求失败

## Changes

- **2026-11-03** `7fd61aa7f811`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/bigmodel/apis/zhipu-ai-api/changes/llm-application/open/v3/application/invoke/post.md)

---

[API](https://skmtc.dev/bigmodel/apis/zhipu-ai-api.md) - [All operations](https://skmtc.dev/bigmodel/apis/zhipu-ai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bigmodel/apis/zhipu-ai-api/revisions/f2be7c0fcbb9?raw)
