Skip to main content
POST
创建响应

服务器工具

/v1/responses 支持常规函数工具,以及以下由 Gateway 管理的服务器工具:
  • gateway:datetime
  • phaseo:web_search
  • phaseo:web_fetch
  • phaseo:advisor
  • phaseo:image_generation
  • phaseo:apply_patch

日期和时间示例

使用服务器工具时,usage 中会包含相应的 usage.server_tool_use.* 计数器。
  • gateway:datetime -> datetime_requests
  • phaseo:web_search -> web_search_requests, web_search_results, web_search_extra_results
  • phaseo:web_fetch -> web_fetch_requests
  • phaseo:advisor -> advisor_requests
  • phaseo:image_generation -> image_generation_requests
  • phaseo:apply_patch -> apply_patch_requests

流式传输说明

同样支持 stream: true。对于 Gateway 管理的服务器工具,Phaseo 可能会先处理上游工具调用轮次、继续循环,再重新发出合成流。

授权

Authorization
string
header
必填

Bearer 令牌身份验证

请求体

application/json
model
string
必填
input
必填
background
boolean
include
string[]
instructions
string
max_output_tokens
integer
必填范围: x >= 1
metadata
object
session_id
string

用于可观测性统计的唯一标识符,可将相关请求(例如对话或代理工作流)归为一组。

Maximum string length: 256
parallel_tool_calls
boolean
previous_response_id
string
reasoning
object
service_tier
enum<string>
可用选项:
standard,
default,
fast,
ultrafast,
priority,
flex,
batch
store
boolean
stream
boolean
temperature
number
必填范围: 0 <= x <= 2
text
object
tool_choice

工具选择策略。接受 Phaseo 服务器工具类型,并将其改写为上游函数或工具目标。

可用选项:
auto,
none,
required,
phaseo:datetime,
phaseo:web_search,
phaseo:web_fetch,
phaseo:subagent,
phaseo:fusion,
phaseo:search_models,
gateway:datetime,
gateway:web_search,
gateway:web_fetch
tools
object[]

用于模型函数调用和网关服务器工具的工具定义。网关内置服务器工具为 gateway:datetime、gateway:web_search 和 gateway:web_fetch。

top_p
number
必填范围: 0 <= x <= 1
truncation
enum<string>
可用选项:
auto,
disabled
user
string
prompt_cache_key
string | null
safety_identifier
string | null
modalities
enum<string>[]
可用选项:
text,
image,
audio
image_config
object
provider_options
object

可选的提供商专用选项。

usage
boolean
meta
boolean
echo_upstream_request
boolean
debug
object

网关调试控制项。这些标志绝不会转发给提供商。

provider
object

用于网关选择的提供商路由偏好设置。

响应

响应

id
string
object
string
created
integer
model
string
provider
string
provider_id
string
nativeResponseId
string | null
status
enum<string>
可用选项:
completed,
failed,
incomplete
finish_reason
string | null
meta
object
cost_nanos
number
cost_cents
integer
currency
string
pricing_lines
object[]
output
object[]
output_items
object[]
content
object[]
role
string
stop_reason
string
type
string
usage
object
最后修改于 2026年10月2日