Skip to main content
POST
创建聊天补全

服务器工具

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

日期和时间示例

使用服务器工具时,usage 中会包含:
phaseo:web_search 会添加 server_tool_use.web_search_requests、server_tool_use.web_search_results 和 server_tool_use.web_search_extra_results。phaseo:web_fetch 会添加 server_tool_use.web_fetch_requests。

流式传输说明

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

授权

Authorization
string
header
必填

Bearer 令牌身份验证

请求体

application/json
model
string
必填
messages
object[]
必填
Minimum array length: 1
reasoning
object
reasoning_effort
enum<string>

reasoning.effort 的 OpenAI 兼容别名。

可用选项:
none,
instant,
minimal,
low,
medium,
high,
xhigh,
max
frequency_penalty
number
必填范围: -2 <= x <= 2
logit_bias
object
max_completion_tokens
integer
必填范围: x >= 1
max_tokens
integer
必填范围: x >= 1
metadata
object
session_id
string

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

Maximum string length: 256
presence_penalty
number
必填范围: -2 <= x <= 2
seed
integer
必填范围: -9223372036854776000 <= x <= 9223372036854776000
store
boolean
stream
boolean
默认值:false
stream_options
object
temperature
number
默认值:1
必填范围: 0 <= x <= 2
tools
object[]

用于模型函数调用和网关服务器工具的工具定义。内置服务器工具包括日期时间、网页搜索、网页抓取、Advisor、Subagent、Fusion、模型搜索、图像生成和补丁创建。

max_tool_calls
integer
必填范围: x >= 1
parallel_tool_calls
boolean
默认值:true
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
logprobs
boolean
默认值:false
top_logprobs
integer
必填范围: 0 <= x <= 20
top_p
number
必填范围: 0 <= x <= 1
stop
response_format
modalities
enum<string>[]
可用选项:
text,
image,
audio
image_config
object
usage
boolean
provider

提供商选择器。单个提供商使用字符串,也可使用 { "only": ["groq"] } 这类路由选项。

可用选项:
openai,
anthropic,
google-ai-studio,
gemini,
mistral,
x-ai,
xai,
groq,
together
provider_options
object

可选的提供商专用选项。

user_id
string
user
string
service_tier
enum<string>
可用选项:
standard,
default,
fast,
ultrafast,
priority,
flex,
batch
prompt_cache_key
string | null
safety_identifier
string | null
meta
boolean
默认值:false
echo_upstream_request
boolean
debug
object

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

响应

聊天补全响应

id
string
nativeResponseId
string | null
object
string
created
integer
model
string
provider
string
choices
object[]
usage
object
最后修改于 2026年10月2日