GPT 5.6 Sol API
由 OpenAI 提供支持的 GPT 5.6 Sol LLM 模型完整 API 参考。
模型变体
此 API 支持四种模型变体:
快速比较
GPT 5.6 Sol Text to Text
端点
POST /api/v1/chat/completions
请求参数
必需
消息支持
可选
请求示例
const response = await fetch('https://api.flaq.ai/api/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'text/event-stream',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gpt-5.6-sol-text-to-text',
messages: [
{
role: 'user',
content: 'Write a short launch announcement for a new AI feature.'
}
],
stream: true,
max_tokens: 2048
})
});
GPT 5.6 Sol Image to Text
端点
POST /api/v1/chat/completions
请求参数
必需
消息支持
可选
请求示例
const response = await fetch('https://api.flaq.ai/api/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'text/event-stream',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gpt-5.6-sol-image-to-text',
messages: [
{
role: 'user',
content: [
{ type: 'text', text: 'Describe the image and extract any visible text.' },
{
type: 'image_url',
image_url: {
url: 'https://example.com/sample-image.jpg'
}
}
]
}
],
stream: true,
max_tokens: 2048
})
});
GPT 5.6 Sol Web Search
端点
POST /api/v1/chat/completions
请求参数
必需
消息支持
可选
请求示例
const response = await fetch('https://api.flaq.ai/api/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'text/event-stream',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gpt-5.6-sol-web-search',
messages: [
{
role: 'user',
content: 'Find recent product launch trends in AI developer tools.'
}
],
stream: true,
max_tokens: 2048
})
});
GPT 5.6 Sol File Analysis
端点
POST /api/v1/chat/completions
请求参数
必需
消息支持
可选
请求示例
const response = await fetch('https://api.flaq.ai/api/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'text/event-stream',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gpt-5.6-sol-file-analysis',
messages: [
{
role: 'user',
content: [
{ type: 'text', text: 'Summarize this document and list the key action items.' },
{
type: 'file',
file: {
filename: 'demo.pdf',
file_data: 'https://example.com/demo.pdf'
}
}
]
}
],
stream: true,
max_tokens: 2048
})
});
响应格式
GPT 5.6 Sol LLM 模型返回与 OpenAI 兼容的补全响应。当 stream: true 时,响应采用服务器发送事件(SSE);当 stream: false 时,响应为单个 JSON 对象。
成功响应
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":1710000000,"model":"gpt-5.6-sol-image-to-text","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":1710000000,"model":"gpt-5.6-sol-image-to-text","choices":[{"index":0,"delta":{"content":"The image shows"},"finish_reason":null}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":1710000000,"model":"gpt-5.6-sol-image-to-text","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":1710000000,"model":"gpt-5.6-sol-image-to-text","choices":[],"usage":{"prompt_tokens":12,"completion_tokens":8,"total_tokens":20}}
data: [DONE]
错误响应
event: error
data: {"error":{"message":"API requests too frequent, exceeding rate limit","type":"rate_limit_error","code":"1302","param":null}}
最佳实践
- 保持消息结构化: 使用
messages[] 保存对话历史,而不是将上下文压缩到一个提示词中。
- 将文件和图像附加到消息: 将
image_url 和 file 部分放在引入它们的消息中。
- 使用 SSE 解析: 追加
choices[0].delta.content 以进行增量显示,并将 data: [DONE] 视为成功完成。
- 仅发送支持的输入: 让文本、图像和文件部分与所选模型变体相匹配。
- 在本地存储请求状态: 数据块包含补全
id,但客户端仍应通过活动请求状态路由这些数据块。