curl --request POST \
--url https://geekai.co/api/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {},
"temperature": 1,
"top_p": 1,
"user": "user-1234",
"service_tier": "auto",
"previous_response_id": "<string>",
"model": "gpt-4o",
"reasoning": {
"effort": "medium"
},
"background": false,
"max_output_tokens": 123,
"text": {
"format": {
"type": "text"
}
},
"tools": [
{
"type": "function",
"name": "<string>",
"parameters": {},
"strict": true,
"description": "<string>"
}
],
"prompt": {
"id": "<string>",
"version": "<string>",
"variables": {}
},
"truncation": "disabled",
"input": "<string>",
"include": [],
"parallel_tool_calls": true,
"store": true,
"instructions": "<string>",
"stream": false
}
'import requests
url = "https://geekai.co/api/v1/responses"
payload = {
"metadata": {},
"temperature": 1,
"top_p": 1,
"user": "user-1234",
"service_tier": "auto",
"previous_response_id": "<string>",
"model": "gpt-4o",
"reasoning": { "effort": "medium" },
"background": False,
"max_output_tokens": 123,
"text": { "format": { "type": "text" } },
"tools": [
{
"type": "function",
"name": "<string>",
"parameters": {},
"strict": True,
"description": "<string>"
}
],
"prompt": {
"id": "<string>",
"version": "<string>",
"variables": {}
},
"truncation": "disabled",
"input": "<string>",
"include": [],
"parallel_tool_calls": True,
"store": True,
"instructions": "<string>",
"stream": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {},
temperature: 1,
top_p: 1,
user: 'user-1234',
service_tier: 'auto',
previous_response_id: '<string>',
model: 'gpt-4o',
reasoning: {effort: 'medium'},
background: false,
max_output_tokens: 123,
text: {format: {type: 'text'}},
tools: [
{
type: 'function',
name: '<string>',
parameters: {},
strict: true,
description: '<string>'
}
],
prompt: {id: '<string>', version: '<string>', variables: {}},
truncation: 'disabled',
input: '<string>',
include: [],
parallel_tool_calls: true,
store: true,
instructions: '<string>',
stream: false
})
};
fetch('https://geekai.co/api/v1/responses', 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://geekai.co/api/v1/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metadata' => [
],
'temperature' => 1,
'top_p' => 1,
'user' => 'user-1234',
'service_tier' => 'auto',
'previous_response_id' => '<string>',
'model' => 'gpt-4o',
'reasoning' => [
'effort' => 'medium'
],
'background' => false,
'max_output_tokens' => 123,
'text' => [
'format' => [
'type' => 'text'
]
],
'tools' => [
[
'type' => 'function',
'name' => '<string>',
'parameters' => [
],
'strict' => true,
'description' => '<string>'
]
],
'prompt' => [
'id' => '<string>',
'version' => '<string>',
'variables' => [
]
],
'truncation' => 'disabled',
'input' => '<string>',
'include' => [
],
'parallel_tool_calls' => true,
'store' => true,
'instructions' => '<string>',
'stream' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://geekai.co/api/v1/responses"
payload := strings.NewReader("{\n \"metadata\": {},\n \"temperature\": 1,\n \"top_p\": 1,\n \"user\": \"user-1234\",\n \"service_tier\": \"auto\",\n \"previous_response_id\": \"<string>\",\n \"model\": \"gpt-4o\",\n \"reasoning\": {\n \"effort\": \"medium\"\n },\n \"background\": false,\n \"max_output_tokens\": 123,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"description\": \"<string>\"\n }\n ],\n \"prompt\": {\n \"id\": \"<string>\",\n \"version\": \"<string>\",\n \"variables\": {}\n },\n \"truncation\": \"disabled\",\n \"input\": \"<string>\",\n \"include\": [],\n \"parallel_tool_calls\": true,\n \"store\": true,\n \"instructions\": \"<string>\",\n \"stream\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://geekai.co/api/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {},\n \"temperature\": 1,\n \"top_p\": 1,\n \"user\": \"user-1234\",\n \"service_tier\": \"auto\",\n \"previous_response_id\": \"<string>\",\n \"model\": \"gpt-4o\",\n \"reasoning\": {\n \"effort\": \"medium\"\n },\n \"background\": false,\n \"max_output_tokens\": 123,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"description\": \"<string>\"\n }\n ],\n \"prompt\": {\n \"id\": \"<string>\",\n \"version\": \"<string>\",\n \"variables\": {}\n },\n \"truncation\": \"disabled\",\n \"input\": \"<string>\",\n \"include\": [],\n \"parallel_tool_calls\": true,\n \"store\": true,\n \"instructions\": \"<string>\",\n \"stream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geekai.co/api/v1/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {},\n \"temperature\": 1,\n \"top_p\": 1,\n \"user\": \"user-1234\",\n \"service_tier\": \"auto\",\n \"previous_response_id\": \"<string>\",\n \"model\": \"gpt-4o\",\n \"reasoning\": {\n \"effort\": \"medium\"\n },\n \"background\": false,\n \"max_output_tokens\": 123,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"description\": \"<string>\"\n }\n ],\n \"prompt\": {\n \"id\": \"<string>\",\n \"version\": \"<string>\",\n \"variables\": {}\n },\n \"truncation\": \"disabled\",\n \"input\": \"<string>\",\n \"include\": [],\n \"parallel_tool_calls\": true,\n \"store\": true,\n \"instructions\": \"<string>\",\n \"stream\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41",
"object": "response",
"created_at": 1741476777,
"status": "completed",
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"model": "gpt-4o-2024-08-06",
"output": [
{
"type": "message",
"id": "msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "The image depicts a scenic landscape with a wooden boardwalk or pathway leading through lush, green grass under a blue sky with some clouds. The setting suggests a peaceful natural area, possibly a park or nature reserve. There are trees and shrubs in the background.",
"annotations": []
}
]
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"reasoning": {
"effort": null,
"summary": null
},
"temperature": 1,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [],
"top_p": 1,
"truncation": "disabled",
"usage": {
"input_tokens": 328,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 52,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 380
},
"user": null,
"metadata": {}
}创建响应
curl --request POST \
--url https://geekai.co/api/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {},
"temperature": 1,
"top_p": 1,
"user": "user-1234",
"service_tier": "auto",
"previous_response_id": "<string>",
"model": "gpt-4o",
"reasoning": {
"effort": "medium"
},
"background": false,
"max_output_tokens": 123,
"text": {
"format": {
"type": "text"
}
},
"tools": [
{
"type": "function",
"name": "<string>",
"parameters": {},
"strict": true,
"description": "<string>"
}
],
"prompt": {
"id": "<string>",
"version": "<string>",
"variables": {}
},
"truncation": "disabled",
"input": "<string>",
"include": [],
"parallel_tool_calls": true,
"store": true,
"instructions": "<string>",
"stream": false
}
'import requests
url = "https://geekai.co/api/v1/responses"
payload = {
"metadata": {},
"temperature": 1,
"top_p": 1,
"user": "user-1234",
"service_tier": "auto",
"previous_response_id": "<string>",
"model": "gpt-4o",
"reasoning": { "effort": "medium" },
"background": False,
"max_output_tokens": 123,
"text": { "format": { "type": "text" } },
"tools": [
{
"type": "function",
"name": "<string>",
"parameters": {},
"strict": True,
"description": "<string>"
}
],
"prompt": {
"id": "<string>",
"version": "<string>",
"variables": {}
},
"truncation": "disabled",
"input": "<string>",
"include": [],
"parallel_tool_calls": True,
"store": True,
"instructions": "<string>",
"stream": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {},
temperature: 1,
top_p: 1,
user: 'user-1234',
service_tier: 'auto',
previous_response_id: '<string>',
model: 'gpt-4o',
reasoning: {effort: 'medium'},
background: false,
max_output_tokens: 123,
text: {format: {type: 'text'}},
tools: [
{
type: 'function',
name: '<string>',
parameters: {},
strict: true,
description: '<string>'
}
],
prompt: {id: '<string>', version: '<string>', variables: {}},
truncation: 'disabled',
input: '<string>',
include: [],
parallel_tool_calls: true,
store: true,
instructions: '<string>',
stream: false
})
};
fetch('https://geekai.co/api/v1/responses', 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://geekai.co/api/v1/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metadata' => [
],
'temperature' => 1,
'top_p' => 1,
'user' => 'user-1234',
'service_tier' => 'auto',
'previous_response_id' => '<string>',
'model' => 'gpt-4o',
'reasoning' => [
'effort' => 'medium'
],
'background' => false,
'max_output_tokens' => 123,
'text' => [
'format' => [
'type' => 'text'
]
],
'tools' => [
[
'type' => 'function',
'name' => '<string>',
'parameters' => [
],
'strict' => true,
'description' => '<string>'
]
],
'prompt' => [
'id' => '<string>',
'version' => '<string>',
'variables' => [
]
],
'truncation' => 'disabled',
'input' => '<string>',
'include' => [
],
'parallel_tool_calls' => true,
'store' => true,
'instructions' => '<string>',
'stream' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://geekai.co/api/v1/responses"
payload := strings.NewReader("{\n \"metadata\": {},\n \"temperature\": 1,\n \"top_p\": 1,\n \"user\": \"user-1234\",\n \"service_tier\": \"auto\",\n \"previous_response_id\": \"<string>\",\n \"model\": \"gpt-4o\",\n \"reasoning\": {\n \"effort\": \"medium\"\n },\n \"background\": false,\n \"max_output_tokens\": 123,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"description\": \"<string>\"\n }\n ],\n \"prompt\": {\n \"id\": \"<string>\",\n \"version\": \"<string>\",\n \"variables\": {}\n },\n \"truncation\": \"disabled\",\n \"input\": \"<string>\",\n \"include\": [],\n \"parallel_tool_calls\": true,\n \"store\": true,\n \"instructions\": \"<string>\",\n \"stream\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://geekai.co/api/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {},\n \"temperature\": 1,\n \"top_p\": 1,\n \"user\": \"user-1234\",\n \"service_tier\": \"auto\",\n \"previous_response_id\": \"<string>\",\n \"model\": \"gpt-4o\",\n \"reasoning\": {\n \"effort\": \"medium\"\n },\n \"background\": false,\n \"max_output_tokens\": 123,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"description\": \"<string>\"\n }\n ],\n \"prompt\": {\n \"id\": \"<string>\",\n \"version\": \"<string>\",\n \"variables\": {}\n },\n \"truncation\": \"disabled\",\n \"input\": \"<string>\",\n \"include\": [],\n \"parallel_tool_calls\": true,\n \"store\": true,\n \"instructions\": \"<string>\",\n \"stream\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geekai.co/api/v1/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {},\n \"temperature\": 1,\n \"top_p\": 1,\n \"user\": \"user-1234\",\n \"service_tier\": \"auto\",\n \"previous_response_id\": \"<string>\",\n \"model\": \"gpt-4o\",\n \"reasoning\": {\n \"effort\": \"medium\"\n },\n \"background\": false,\n \"max_output_tokens\": 123,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"<string>\",\n \"parameters\": {},\n \"strict\": true,\n \"description\": \"<string>\"\n }\n ],\n \"prompt\": {\n \"id\": \"<string>\",\n \"version\": \"<string>\",\n \"variables\": {}\n },\n \"truncation\": \"disabled\",\n \"input\": \"<string>\",\n \"include\": [],\n \"parallel_tool_calls\": true,\n \"store\": true,\n \"instructions\": \"<string>\",\n \"stream\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41",
"object": "response",
"created_at": 1741476777,
"status": "completed",
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"model": "gpt-4o-2024-08-06",
"output": [
{
"type": "message",
"id": "msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "The image depicts a scenic landscape with a wooden boardwalk or pathway leading through lush, green grass under a blue sky with some clouds. The setting suggests a peaceful natural area, possibly a park or nature reserve. There are trees and shrubs in the background.",
"annotations": []
}
]
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"reasoning": {
"effort": null,
"summary": null
},
"temperature": 1,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [],
"top_p": 1,
"truncation": "disabled",
"usage": {
"input_tokens": 328,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 52,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 380
},
"user": null,
"metadata": {}
}授权
API认证token
请求体
一对可以附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息以及通过 API 或仪表板查询对象非常有用。
键是长度最多为 64 个字符的字符串。值是长度最多为 512 个字符的字符串。
Show child attributes
Show child attributes
要使用的采样温度,介于 0 和 2 之间。较高的值(如 0.8)将使输出更随机,而较低的值(如 0.2)将使其更聚焦和确定。
我们通常建议修改此项或 top_p,但不要同时修改两者。
0 <= x <= 21
采样温度的另一种方法,称为核采样,模型会考虑具有 top_p 概率质量的 token 的结果。因此,0.1 意味着只考虑包含前 10% 概率质量的 token。
我们通常建议修改此项或 temperature,但不要同时修改两者。
0 <= x <= 11
指定用于处理请求的延迟等级。此参数适用于订阅了按量计费服务的客户: - 如果设置为“auto”,并且项目启用了按量计费服务,系统将使用按量计费积分直至用尽。 - 如果设置为“auto”,但项目未启用按量计费服务,则请求将使用默认服务等级进行处理,该等级的正常运行时间服务水平协议较低,且无延迟保证。 - 如果设置为“default”,请求将使用默认服务等级进行处理,该等级的正常运行时间服务水平协议较低,且无延迟保证。 - 如果设置为“flex”,请求将使用弹性处理服务等级进行处理。了解更多。 - 如果未设置,则默认行为是“auto”。
设置此参数后,响应体将包含所使用的 service_tier。
auto, default, flex, scale 模型在生成响应时应如何选择使用哪个工具(或多个工具)。请参阅 tools 参数以了解如何指定模型可以调用的工具。
none, auto, required 对提示模板及其变量的引用。
Show child attributes
Show child attributes
用于模型响应的截断策略。
auto:如果此响应及之前的响应的上下文超出了模型的上下文窗口大小,模型将通过删除对话中间的输入项来截断响应以适应上下文窗口。disabled(默认):如果模型响应将超出模型的上下文窗口大小,请求将失败并返回 400 错误。
auto, disabled 指定模型响应中需额外包含的数据。目前支持以下值:
file_search_call.results: 包含文件搜索工具调用所产生的搜索结果。message.input_image.image_url: 包含输入消息中的图片链接。computer_call_output.output.image_url: 包含计算机调用(computer call)输出的图片链接。reasoning.encrypted_content: 在推理项(reasoning item)的输出中,包含对推理过程令牌(reasoning tokens)的加密版本。如此一来,当以无状态方式使用 Responses API 时(例如,当 store 参数设置为 false,或当组织加入了“零数据保留”计划时),推理项便可在多轮对话中继续使用。code_interpreter_call.outputs: 包含代码解释器工具调用项中,Python 代码的执行输出。
指定要在模型响应中包含的附加输出数据。当前支持的值包括:
file_search_call.results: 包含文件搜索工具调用的搜索结果。message.input_image.image_url: 包含输入消息中的图像 URL。computer_call_output.output.image_url: 包含计算机调用输出中的图像 URL。reasoning.encrypted_content: 在推理项输出中包含加密版本的推理 token。这使得在无状态使用响应 API(例如store参数设置为false,或组织已加入零数据保留计划时)的多轮对话中使用推理项成为可能。code_interpreter_call.outputs: 包含代码解释器工具调用项中 Python 代码执行的输出。
file_search_call.results, message.input_image.image_url, computer_call_output.output.image_url, reasoning.encrypted_content, code_interpreter_call.outputs 是否允许模型并行执行工具调用
是否存储生成的模型响应,以供后续通过 API 检索
插入到模型上下文中的系统(或开发者)消息。
当与 previous_response_id 一同使用时,先前响应中的指令将不会被沿用至新的响应中。这使得在新响应中可以轻松地替换系统(或开发者)消息。
若设为 true,模型响应数据将在生成时,通过 Server-Sent Events 流式传输至客户端。 代码示例
响应
OK
一对可以附加到对象的 16 个键值对。这对于以结构化格式存储有关对象的附加信息以及通过 API 或仪表板查询对象非常有用。
键是长度最多为 64 个字符的字符串。值是长度最多为 512 个字符的字符串。
Show child attributes
Show child attributes
要使用的采样温度,介于 0 和 2 之间。较高的值(如 0.8)将使输出更随机,而较低的值(如 0.2)将使其更聚焦和确定。
我们通常建议修改此项或 top_p,但不要同时修改两者。
0 <= x <= 21
采样温度的另一种方法,称为核采样,模型会考虑具有 top_p 概率质量的 token 的结果。因此,0.1 意味着只考虑包含前 10% 概率质量的 token。
我们通常建议修改此项或 temperature,但不要同时修改两者。
0 <= x <= 11
模型在生成响应时应如何选择使用哪个工具(或多个工具)。请参阅 tools 参数以了解如何指定模型可以调用的工具。
none, auto, required 此响应的唯一标识符
该资源的对象类型 - 始终设置为 response。
response 此响应创建时的 Unix 时间戳(以秒为单位)。
当模型未能生成响应时返回的错误对象。
Show child attributes
Show child attributes
响应不完整的详细信息。
Show child attributes
Show child attributes
由模型生成的内容项数组。
output数组中项目的长度和顺序取决于模型的响应。- 与其访问
output数组中的第一个项目并假设它是包含模型生成内容的assistant消息,不如考虑在 SDK 中使用output_text属性(如果支持)。
来自模型的输出消息。
Show child attributes
Show child attributes
插入到模型上下文中的系统(或开发者)消息。
当与 previous_response_id 一起使用时,前一个响应中的指令不会延续到下一个响应。这使得在新的响应中轻松替换系统(或开发者)消息变得容易。
是否允许模型并行运行工具调用。
指定用于处理请求的延迟等级。此参数适用于订阅了按量计费服务的客户: - 如果设置为“auto”,并且项目启用了按量计费服务,系统将使用按量计费积分直至用尽。 - 如果设置为“auto”,但项目未启用按量计费服务,则请求将使用默认服务等级进行处理,该等级的正常运行时间服务水平协议较低,且无延迟保证。 - 如果设置为“default”,请求将使用默认服务等级进行处理,该等级的正常运行时间服务水平协议较低,且无延迟保证。 - 如果设置为“flex”,请求将使用弹性处理服务等级进行处理。了解更多。 - 如果未设置,则默认行为是“auto”。
设置此参数后,响应体将包含所使用的 service_tier。
auto, default, flex, scale 对提示模板及其变量的引用。
Show child attributes
Show child attributes
用于模型响应的截断策略。
auto:如果此响应及之前的响应的上下文超出了模型的上下文窗口大小,模型将通过删除对话中间的输入项来截断响应以适应上下文窗口。disabled(默认):如果模型响应将超出模型的上下文窗口大小,请求将失败并返回 400 错误。
auto, disabled 响应生成的状态。可能的值有 completed、failed、
in_progress、cancelled、queued 或 incomplete。
completed, failed, in_progress, cancelled, queued, incomplete 仅限 SDK 的便利属性,包含 output 数组中所有 output_text 项的聚合文本输出(如果存在)。
在 Python 和 JavaScript SDK 中支持。
表示令牌使用详情,包括输入令牌、输出令牌、输出令牌的明细以及使用的总令牌。
Show child attributes
Show child attributes
此页面对您有帮助吗?
