Phản hồi truy vấn (OpenAI Responses API)
curl --request GET \
--url https://api.aiid.edu.kg/v1/responses/{response_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aiid.edu.kg/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://api.aiid.edu.kg/v1/responses/{response_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aiid.edu.kg/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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aiid.edu.kg/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))
}HttpResponse<String> response = Unirest.get("https://api.aiid.edu.kg/v1/responses/{response_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiid.edu.kg/v1/responses/{response_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "resp_xxx",
"created_at": 1780649146,
"error": null,
"incomplete_details": null,
"instructions": null,
"metadata": {},
"model": "gpt-image-2-2k",
"object": "response",
"output": [
{
"id": "ig_010c31178d26436ca6194cde07931b33_0",
"result": null,
"status": "completed",
"type": "image_generation_call",
"url": "https://example.png"
}
],
"parallel_tool_calls": true,
"temperature": null,
"tool_choice": null,
"tools": null,
"top_p": null,
"max_output_tokens": null,
"previous_response_id": null,
"reasoning": null,
"status": "completed",
"text": null,
"truncation": null,
"usage": null,
"user": null,
"store": null
}Định dạng OpenAI (Responses)
Phản hồi truy vấn (OpenAI Responses API)
OpenAI Responses API giao diện truy vấn tác vụ bất đồng bộ. response_id Hãy sử dụng đầy đủ id được trả về khi tạo phản hồi, không cắt ngắn hoặc viết lại.
Truy vấn tác vụ hình ảnh bất đồng bộ của OpenAI Responses API. response_id Phải sử dụng đầy đủ id do POST /v1/responses trả về, ví dụ resp_xxx.
Ví dụ truy vấn bất đồng bộ
GET /v1/responses/resp_xxx
Giải thích tương đương của tham số đường dẫn:
{
"response_id": "resp_xxx"
}
Ví dụ phản hồi ở trạng thái hoàn tất:
{
"id": "resp_xxx",
"created_at": 1780649146,
"error": null,
"incomplete_details": null,
"instructions": null,
"metadata": {},
"model": "gpt-image-2-2k",
"object": "response",
"output": [
{
"id": "ig_010c31178d26436ca6194cde07931b33_0",
"result": null,
"status": "completed",
"type": "image_generation_call",
"url": "https://example.png"
}
],
"parallel_tool_calls": true,
"temperature": null,
"tool_choice": null,
"tools": null,
"top_p": null,
"max_output_tokens": null,
"previous_response_id": null,
"reasoning": null,
"status": "completed",
"text": null,
"truncation": null,
"usage": null,
"user": null,
"store": null
}
GET
/
v1
/
responses
/
{response_id}
Phản hồi truy vấn (OpenAI Responses API)
curl --request GET \
--url https://api.aiid.edu.kg/v1/responses/{response_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aiid.edu.kg/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://api.aiid.edu.kg/v1/responses/{response_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aiid.edu.kg/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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aiid.edu.kg/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))
}HttpResponse<String> response = Unirest.get("https://api.aiid.edu.kg/v1/responses/{response_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiid.edu.kg/v1/responses/{response_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "resp_xxx",
"created_at": 1780649146,
"error": null,
"incomplete_details": null,
"instructions": null,
"metadata": {},
"model": "gpt-image-2-2k",
"object": "response",
"output": [
{
"id": "ig_010c31178d26436ca6194cde07931b33_0",
"result": null,
"status": "completed",
"type": "image_generation_call",
"url": "https://example.png"
}
],
"parallel_tool_calls": true,
"temperature": null,
"tool_choice": null,
"tools": null,
"top_p": null,
"max_output_tokens": null,
"previous_response_id": null,
"reasoning": null,
"status": "completed",
"text": null,
"truncation": null,
"usage": null,
"user": null,
"store": null
}Ủy quyền
Sử dụng xác thực Bearer Token.
Định dạng: Authorization: Bearer sk-xxxxxx
Tham số đường dẫn
Tạo id đầy đủ được trả về trong phản hồi.
Ví dụ:
"resp_xxx"
Phản hồi
200 - application/json
OK
Response ID。
Ví dụ:
"resp_xxx"
Ví dụ:
"response"
Trạng thái tác vụ, thường là queued, in_progress, completed, failed.
Ví dụ:
"in_progress"
Đối tượng lỗi khi thất bại.
