> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bigmodel.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 查询 Response

> 按 `id` 检索已保存的 Response。创建时须 `store=true`。点击 **Try it** 可试用。



## OpenAPI

````yaml /openapi/openapi-responses.json get /v1/responses/{response_id}
openapi: 3.0.1
info:
  title: 智谱 AI Response API
  version: 1.0.0
  description: >-
    创建、查询与删除模型 Response。端点 `https://open.bigmodel.cn/api/v1`。概念见 [Response
    API](/cn/guide/develop/responses/introduction)。
  contact:
    name: Z.AI 开发者
    url: https://chat.z.ai/legal-agreement/privacy-policy
    email: user_feedback@z.ai
servers:
  - url: https://open.bigmodel.cn/api
    description: 开放平台 Response API
security:
  - bearerAuth: []
tags:
  - name: Response
    description: 创建、查询、列举输入项与删除 Response。
paths:
  /v1/responses/{response_id}:
    get:
      tags:
        - Response
      summary: 查询 Response
      description: 按 `id` 检索已保存的 Response。创建时须 `store=true`。点击 **Try it** 可试用。
      operationId: getResponse
      parameters:
        - name: response_id
          in: path
          required: true
          description: 要检索的响应 ID，即创建响应时返回的 `id`。
          schema:
            type: string
            example: resp_xxx
      responses:
        '200':
          description: 业务处理成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
        default:
          description: 请求失败。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Response:
      type: object
      description: 同步请求返回的 Response 对象。
      properties:
        id:
          type: string
          description: 本次请求的唯一标识。
        object:
          type: string
          enum:
            - response
          description: 固定为 `response`。
        created_at:
          type: integer
          format: int64
          description: 请求创建时间，Unix 秒时间戳。
        model:
          type: string
          description: 模型名称。
        instructions:
          type: string
          description: 系统指令。
        max_output_tokens:
          type: integer
          format: int64
          description: 模型输出最大 token 数，包含回答和思维链。
        status:
          type: string
          enum:
            - completed
            - failed
            - in_progress
            - incomplete
          description: 生成状态。
        temperature:
          type: number
          format: float
          description: 采样温度。
        top_p:
          type: number
          format: float
          description: 核采样概率阈值。
        text:
          $ref: '#/components/schemas/TextConfig'
        tools:
          type: array
          description: 同入参 `tools`。
          items:
            $ref: '#/components/schemas/Tool'
        error:
          nullable: true
          description: 模型未能生成响应时的错误对象。
          allOf:
            - $ref: '#/components/schemas/ResponseError'
        incomplete_details:
          nullable: true
          description: 响应未能完成的细节。
          allOf:
            - $ref: '#/components/schemas/IncompleteDetails'
        output:
          type: array
          description: 本轮输出：回答、思维链、工具调用、联网搜索。
          items:
            $ref: '#/components/schemas/OutputItem'
        usage:
          $ref: '#/components/schemas/Usage'
    Error:
      type: object
      description: >-
        Response API 错误。`error.code` 为字符串，与对话补全的数字业务码不是同一套。


        | code | 含义 |

        | --- | --- |

        | `invalid_request` | 请求参数或格式错误 |

        | `model_not_found` | 模型不存在 |

        | `not_implemented` | 接口或能力未实现 |

        | `request_too_large` | 请求体超过大小限制 |

        | `authentication_error` / `invalid_api_key` / `expired` | 认证失败 |

        | `permission_denied` | 权限不足 |

        | `context_length_exceeded` | 输入超过模型上下文窗口 |

        | `rate_limit_exceeded` | 请求频率超限 |

        | `insufficient_quota` / `quota_exceeded` / `usage_limit_reached` /
        `usage_not_included` | 额度或用量限制 |

        | `server_error` | 服务端内部错误 |

        | `server_is_overloaded` / `overloaded` / `slow_down` | 服务过载或要求降速 |

        | `content_filter` / `cyber_policy` | 内容或安全策略拦截 |
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: 错误码，例如 `invalid_request`。
            message:
              type: string
              description: 错误描述。
    TextConfig:
      type: object
      description: 模型文本输出格式，可以是自然语言或结构化 JSON。
      properties:
        format:
          type: object
          properties:
            type:
              type: string
              enum:
                - text
                - json_object
              description: '`text` 为自然语言，`json_object` 为 JSON 对象。'
    Tool:
      oneOf:
        - $ref: '#/components/schemas/FunctionTool'
          title: 函数工具
        - $ref: '#/components/schemas/NamespaceTool'
          title: 命名空间工具
        - $ref: '#/components/schemas/CustomTool'
          title: 自定义工具
        - $ref: '#/components/schemas/WebSearchTool'
          title: 联网搜索
    ResponseError:
      type: object
      properties:
        code:
          type: string
          description: 错误码，见 Error 说明。
        message:
          type: string
          description: 错误描述。
    IncompleteDetails:
      type: object
      properties:
        reason:
          type: string
          description: 响应未能完成的原因。
    OutputItem:
      oneOf:
        - $ref: '#/components/schemas/OutputMessage'
          title: 助手回答
        - $ref: '#/components/schemas/OutputReasoning'
          title: 思维链输出
        - $ref: '#/components/schemas/OutputFunctionCall'
          title: 函数调用
        - $ref: '#/components/schemas/OutputWebSearchCall'
          title: 联网搜索调用
    Usage:
      type: object
      properties:
        input_tokens:
          type: integer
          description: 输入 token 数量。
        input_tokens_details:
          type: object
          description: 输入 token 明细。
          properties:
            cached_tokens:
              type: integer
              description: 缓存 tokens。
        output_tokens:
          type: integer
          description: 模型输出 tokens 数量。
        output_tokens_details:
          type: object
          description: 输出 tokens 明细。
          properties:
            reasoning_tokens:
              type: integer
              description: 模型思考的 tokens 数量。
    FunctionTool:
      type: object
      required:
        - type
        - name
      properties:
        type:
          type: string
          enum:
            - function
          description: 工具类型，此处为 `function`。
        name:
          type: string
          description: 函数名称。
        description:
          type: string
          description: 函数描述，模型用它判断是否调用。
        parameters:
          type: object
          description: 函数请求参数，JSON Schema。
          additionalProperties: true
          example:
            type: object
            properties:
              city:
                type: string
                description: 城市名称
            required:
              - city
      title: 函数工具
    NamespaceTool:
      type: object
      required:
        - type
        - name
      properties:
        type:
          type: string
          enum:
            - namespace
          description: 工具类型，此处为 `namespace`。
        name:
          type: string
          description: 命名空间名称。
        description:
          type: string
          description: 展示给模型的命名空间描述。
        tools:
          type: array
          description: 该命名空间内的函数工具。
          items:
            $ref: '#/components/schemas/FunctionTool'
      title: 命名空间工具
    CustomTool:
      type: object
      required:
        - type
        - name
      properties:
        type:
          type: string
          enum:
            - custom
          description: 自定义工具类型，此处为 `custom`。
        name:
          type: string
          description: 自定义工具名称。
        description:
          type: string
          description: 可选描述，提供更多上下文。
      title: 自定义工具
    WebSearchTool:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - web_search
          description: 服务端网络搜索，类型为 `web_search`。
      title: 联网搜索
    OutputMessage:
      type: object
      properties:
        type:
          type: string
          enum:
            - message
          description: 输出消息类型，此处为 `message`。
        role:
          type: string
          enum:
            - assistant
          description: 固定为 `assistant`。
        status:
          type: string
          description: 输出消息状态。
        id:
          type: string
          description: 此回答的唯一标识。
        content:
          description: 模型回答内容。
          oneOf:
            - $ref: '#/components/schemas/OutputTextPart'
              title: 输出文本
            - type: array
              items:
                $ref: '#/components/schemas/OutputTextPart'
              title: 输出文本列表
      title: 助手回答
    OutputReasoning:
      type: object
      properties:
        type:
          type: string
          enum:
            - reasoning
          description: 输出类型，此处为 `reasoning`。
        status:
          type: string
          description: 输出消息状态。
        id:
          type: string
          description: 此输出项的唯一标识。
        content:
          $ref: '#/components/schemas/ReasoningTextPart'
      title: 思维链输出
    OutputFunctionCall:
      type: object
      properties:
        type:
          type: string
          enum:
            - function_call
          description: 工具调用类型，此处为 `function_call`。
        namespace:
          type: string
          description: 待执行函数所属命名空间。
        status:
          type: string
          description: 输出消息状态。
        id:
          type: string
          description: 此输出项的唯一标识。
        name:
          type: string
          description: 要运行的函数名称。
        call_id:
          type: string
          description: 模型生成的函数调用唯一 ID。
        arguments:
          type: string
          description: 传递给函数的参数 JSON 字符串。
      title: 函数调用
    OutputWebSearchCall:
      type: object
      properties:
        type:
          type: string
          enum:
            - web_search_call
          description: 网络搜索调用类型，此处为 `web_search_call`。
        status:
          type: string
          description: 输出消息状态。
        id:
          type: string
          description: 此输出项的唯一标识。
        action:
          type: object
          description: 此次搜索调用中执行的操作。
          properties:
            type:
              type: string
              enum:
                - search
              description: 操作类型，此处为 `search`。
            queries:
              type: array
              items:
                type: string
              description: 本次搜索关键词。
            source:
              type: array
              items:
                type: string
              description: 联网搜索的附加内容源。
        result:
          type: array
          description: 搜索结果。
          items:
            type: object
            additionalProperties: true
      title: 联网搜索调用
    OutputTextPart:
      type: object
      properties:
        type:
          type: string
          enum:
            - output_text
          description: 固定为 `output_text`。
        text:
          type: string
          description: 模型回答的文本内容。
      title: 输出文本
    ReasoningTextPart:
      type: object
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - reasoning_text
          description: 输出文本类型，此处为 `reasoning_text`。
        text:
          type: string
          description: 推理文本。
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        标准 HTTP Bearer 认证。在 [API
        Keys](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) 获取密钥。

````