GPT-5.4 是一款支持文本生成、代码编写、推理分析、图片理解(Vision)、Function Calling 和 Structured Output 的大型语言模型。
兼容 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 |
| 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","messages":[{"role":"user","content":"你好"}]}'
{"id": "chatcmpl_abc123","object": "chat.completion","created": 1780470861,"model": "gpt-5.4","choices": [{"index": 0,"message": {"role": "assistant","content": "你好!有什么可以帮助你的吗?"},"finish_reason": "stop"}],"usage": {"prompt_tokens": 8,"completion_tokens": 12,"total_tokens": 20}}
{"model":"gpt-5.4","messages":[{"role":"system","content":"你是一名资深运维工程师"},{"role":"user","content":"CentOS如何安装Nginx?"}]}
支持 Base64 图片输入。
{"model":"gpt-5.4","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","choices":[{"message":{"role":"assistant","content":"图片中是一只橘猫坐在沙发上。"},"finish_reason":"stop"}]}
{"model":"gpt-5.4","messages":[{"role":"user","content":"返回一个用户对象"}],"response_format":{"type":"json_object"}}
{"name":"Tom","age":25,"email":"tom@example.com"}
{"model":"gpt-5.4","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_001","type":"function","function":{"name":"get_weather","arguments":"{\"city\":\"上海\"}"}}]},"finish_reason":"tool_calls"}]}
{"model":"gpt-5.4","stream":true,"messages":[{"role":"user","content":"介绍一下Linux"}]}
data: {"choices":[{"delta":{"content":"Linux"}}]}data: {"choices":[{"delta":{"content":" 是一个开源操作系统..."}}]}data: [DONE]
{"usage": {"prompt_tokens": 120,"completion_tokens": 280,"total_tokens": 400}}
GET /v1/models
{"object":"list","data":[{"id":"gpt-5.4","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"}}