查询 Response
curl --request GET \
--url https://open.bigmodel.cn/api/v1/responses/{response_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://open.bigmodel.cn/api/v1/responses/{response_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://open.bigmodel.cn/api/v1/responses/{response_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://open.bigmodel.cn/api/v1/responses/{response_id}")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://open.bigmodel.cn/api/v1/responses/{response_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://open.bigmodel.cn/api/v1/responses/{response_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "<string>",
"object": "response",
"created_at": 123,
"model": "<string>",
"instructions": "<string>",
"max_output_tokens": 123,
"status": "completed",
"temperature": 123,
"top_p": 123,
"text": {
"format": {
"type": "text"
}
},
"tools": [
{
"type": "function",
"name": "<string>",
"description": "<string>",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "城市名称"
}
},
"required": [
"city"
]
}
}
],
"error": {
"code": "<string>",
"message": "<string>"
},
"incomplete_details": {
"reason": "<string>"
},
"output": [
{
"type": "message",
"role": "assistant",
"status": "<string>",
"id": "<string>",
"content": {
"type": "output_text",
"text": "<string>"
}
}
],
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"cached_tokens": 123
},
"output_tokens": 123,
"output_tokens_details": {
"reasoning_tokens": 123
}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Response
查询 Response
按 id 检索已保存的 Response。创建时须 store=true。点击 Try it 可试用。
GET
/
v1
/
responses
/
{response_id}
查询 Response
curl --request GET \
--url https://open.bigmodel.cn/api/v1/responses/{response_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://open.bigmodel.cn/api/v1/responses/{response_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://open.bigmodel.cn/api/v1/responses/{response_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://open.bigmodel.cn/api/v1/responses/{response_id}")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://open.bigmodel.cn/api/v1/responses/{response_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://open.bigmodel.cn/api/v1/responses/{response_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "<string>",
"object": "response",
"created_at": 123,
"model": "<string>",
"instructions": "<string>",
"max_output_tokens": 123,
"status": "completed",
"temperature": 123,
"top_p": 123,
"text": {
"format": {
"type": "text"
}
},
"tools": [
{
"type": "function",
"name": "<string>",
"description": "<string>",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "城市名称"
}
},
"required": [
"city"
]
}
}
],
"error": {
"code": "<string>",
"message": "<string>"
},
"incomplete_details": {
"reason": "<string>"
},
"output": [
{
"type": "message",
"role": "assistant",
"status": "<string>",
"id": "<string>",
"content": {
"type": "output_text",
"text": "<string>"
}
}
],
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"cached_tokens": 123
},
"output_tokens": 123,
"output_tokens_details": {
"reasoning_tokens": 123
}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Path Parameters
要检索的响应 ID,即创建响应时返回的 id。
Example:
"resp_xxx"
Response
业务处理成功
同步请求返回的 Response 对象。
本次请求的唯一标识。
固定为 response。
Available options:
response 请求创建时间,Unix 秒时间戳。
模型名称。
系统指令。
模型输出最大 token 数,包含回答和思维链。
生成状态。
Available options:
completed, failed, in_progress, incomplete 采样温度。
核采样概率阈值。
模型文本输出格式,可以是自然语言或结构化 JSON。
Show child attributes
Show child attributes
同入参 tools。
- 函数工具
- 命名空间工具
- 自定义工具
- 联网搜索
Show child attributes
Show child attributes
模型未能生成响应时的错误对象。
Show child attributes
Show child attributes
响应未能完成的细节。
Show child attributes
Show child attributes
本轮输出:回答、思维链、工具调用、联网搜索。
- 助手回答
- 思维链输出
- 函数调用
- 联网搜索调用
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?