AIAPIZZ 登录 免费注册

模型后缀与高级参数

共 14 篇

模型名后缀

本站的模型名支持在末尾加后缀,让同一个模型切换行为,不需要改请求体:

后缀作用示例
-thinking开启扩展思考(reasoning),网关会注入 thinking 参数claude-sonnet-5-thinking
-high思考/推理强度 = high(reasoning_effort: high)gpt-5-high
-medium推理强度 = mediumgpt-5-medium
-low推理强度 = lowgpt-5-low
# 同一个模型,两个强度
curl https://aiapizz.com/v1/chat/completions -H "Authorization: Bearer sk-你的密钥" -H "Content-Type: application/json" \
  -d '{"model":"gpt-5-high","messages":[{"role":"user","content":"这道题怎么解?"}]}'

后缀由网关解析后从模型名里去掉再去匹配渠道,所以 gpt-5-high 与 gpt-5 走的是同一批渠道。若上游不支持对应参数,会在响应里报参数错误,这时去掉后缀即可。

常用高级参数

这些参数都是原样转发给上游的,能不能生效取决于模型/上游:

参数说明
reasoning_effortlow / medium / high,推理模型的思考强度
thinking扩展思考,如 {"type":"enabled","budget_tokens":4096}
response_format{"type":"json_object"} 或 {"type":"json_schema","json_schema":{...}},结构化输出
tools / tool_choice函数调用(工具)
parallel_tool_calls是否允许并行工具调用
logprobs / top_logprobs返回 token 概率
seed固定随机种子(上游支持时才有确定性)
stop停止序列
logit_biastoken 级别的偏置

函数调用

{
  "model": "gpt-4o-mini",
  "messages": [{"role": "user", "content": "北京现在天气怎么样?"}],
  "tools": [{
    "type": "function",
    "function": {
      "name": "get_weather",
      "description": "查询指定城市的天气",
      "parameters": {
        "type": "object",
        "properties": {"city": {"type": "string", "description": "城市名"}},
        "required": ["city"]
      }
    }
  }],
  "tool_choice": "auto"
}

返回里会出现 finish_reason: "tool_calls" 与 message.tool_calls;把工具执行结果以 {"role":"tool","tool_call_id":"...","content":"..."} 追加进 messages 再请求一次即可。流式下 tool_calls 会分片到达,需要按 index 拼接。

结构化输出

r = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "列出三种水果,返回 JSON"}],
    response_format={"type": "json_object"},
)

跨格式调用时(比如用 OpenAI 格式调 Gemini 模型),网关会把 response_format / tools 尽力翻译成目标格式的等价字段;置信度不高的字段会被忽略而不是报错。

模型映射

如果你有一段代码里写死了 gpt-4,但现在只想让它走 gpt-4o,不用改代码:在控制台编辑该密钥,把「模型映射」填成 {"gpt-4":"gpt-4o"}。网关在鉴权和模型范围检查之前先做映射,所以密钥的模型范围里勾 gpt-4o 就够了。

备用模型

密钥里可以配置备用模型列表(按顺序)。主模型的所有渠道都失败时,网关会自动换下一个模型重试,事件全程记在同一次调用的日志里。适合把「贵而稳」和「便宜而备用」配对,节省业务层的重试代码。

你的接口地址是 https://aiapizz.com/v1。 注册后即可在控制台创建密钥。
AIAPIZZ  · 模型广场  · 接口文档  · 服务条款  · 隐私政策
This website is independently developed and operated by the AIAPIZZ team. It is not affiliated with, authorized by, endorsed by, or otherwise associated with any other AI website, platform, brand, or service provider.
© 2026 AIAPIZZ