GPT-5.4-Mini 是 GPT-5.4 系列的轻量级模型,在保持优秀推理和代码能力的同时,具有更低延迟和更低成本,适用于:
兼容 OpenAI Chat Completions API。
https://api.yisu.com
所有请求均需携带 API Key。
Authorization: Bearer YOUR_API_KEYContent-Type: application/json
POST /v1/chat/completions
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 固定为 gpt-5.4-mini |
| messages | array | 是 | 对话消息 |
| temperature | number | 否 | 随机性控制 |
| top_p | number | 否 | Top-P采样 |
| max_completion_tokens | integer | 否 | 最大输出Token数 |
| stream | boolean | 否 | 是否启用流式输出 |
| response_format | object | 否 | JSON输出模式 |
| tools | array | 否 | Function Calling工具 |
| tool_choice | string/object | 否 | 工具调用策略 |
curl https://api.yisu.com/v1/chat/completions \-H "Authorization: Bearer YOUR_API_KEY" \-H "Content-Type: application/json" \-d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"你好"}]}'
{"id":"chatcmpl_mini_001","object":"chat.completion","created":1780470861,"model":"gpt-5.4-mini","choices":[{"index":0,"message":{"role":"assistant","content":"你好!有什么可以帮助你的吗?"},"finish_reason":"stop"}],"usage":{"prompt_tokens":8,"completion_tokens":12,"total_tokens":20}}
{"model":"gpt-5.4-mini","messages":[{"role":"system","content":"你是一位资深PHP开发工程师"},{"role":"user","content":"写一个Redis连接示例"}]}
支持 Base64 图片输入。
{"model":"gpt-5.4-mini","messages":[{"role":"user","content":[{"type":"text","text":"分析这张图片"},{"type":"image","image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."}]}]}
{"id":"chatcmpl_vision001","object":"chat.completion","created":1780470861,"model":"gpt-5.4-mini","choices":[{"message":{"role":"assistant","content":"图片中是一只橘色猫咪躺在沙发上。"},"finish_reason":"stop"}]}
{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"返回一个订单对象"}],"response_format":{"type":"json_object"}}
{"order_id":"ORD20260604001","amount":99.9,"status":"paid"}
{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"查询北京天气"}],"tools":[{"type":"function","function":{"name":"get_weather","description":"查询天气信息","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}]}
{"choices":[{"message":{"role":"assistant","tool_calls":[{"id":"call_weather_001","type":"function","function":{"name":"get_weather","arguments":"{\"city\":\"北京\"}"}}]},"finish_reason":"tool_calls"}]}
{"model":"gpt-5.4-mini","stream":true,"messages":[{"role":"user","content":"介绍一下Docker"}]}
data: {"choices":[{"delta":{"content":"Docker"}}]}data: {"choices":[{"delta":{"content":" 是一个开源容器平台..."}}]}data: [DONE]
{"usage":{"prompt_tokens":120,"completion_tokens":180,"total_tokens":300}}
GET /v1/models
{"object":"list","data":[{"id":"gpt-5.4-mini","object":"model","created":1780000000,"owned_by":"system"}]}
{"error":{"message":"Invalid API key.","type":"authentication_error","code":"invalid_api_key"}}
{"error":{"message":"Rate limit exceeded.","type":"rate_limit_error","code":"rate_limit_exceeded"}}
{"error":{"message":"Invalid request.","type":"invalid_request_error","code":"invalid_request"}}