Claude Code 指南
配置 Flaq AI Claude 模型并探索 Claude Code 技能
免费试用 GPT 5.6 Luna 图生文 API,进行快速视觉理解、OCR、图表分析和经济实惠的大批量工作流。
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-luna-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
})
});
const reader = response.body.getReader();
const decoder = new TextDecoder();
let buffer = '';
let assistantText = '';
while (true) {
const { done, value } = await reader.read();
if (done) break;
buffer += decoder.decode(value, { stream: true });
const frames = buffer.split('\n\n');
buffer = frames.pop() || '';
for (const frame of frames) {
const lines = frame.split('\n').filter(Boolean);
let eventName = 'message';
const dataLines = [];
for (const line of lines) {
if (line.startsWith('event:')) {
eventName = line.slice(6).trim();
} else if (line.startsWith('data:')) {
dataLines.push(line.replace(/^data:\s*/, ''));
}
}
const raw = dataLines.join('\n').trim();
if (raw === '[DONE]') {
console.log('\nFinal text:', assistantText);
continue;
}
let payload;
try {
payload = JSON.parse(raw);
} catch {
continue;
}
if (eventName === 'error' || payload.error) {
const msg = payload.error?.message ?? payload.message ?? 'Chat request failed';
throw new Error(msg);
}
const delta = payload.choices?.[0]?.delta;
if (delta?.content) {
assistantText += delta.content;
console.log(assistantText);
}
}
}
import json
import requests
response = requests.post(
'https://api.flaq.ai/api/v1/chat/completions',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'text/event-stream',
'Content-Type': 'application/json',
},
json={
'model': 'gpt-5.6-luna-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,
},
stream=True,
)
response.raise_for_status()
event_name = 'message'
assistant_text = ''
for raw_line in response.iter_lines(decode_unicode=True):
if not raw_line:
event_name = 'message'
continue
if raw_line.startswith('event:'):
event_name = raw_line.replace('event:', '', 1).strip()
continue
if raw_line.startswith('data:'):
raw_data = raw_line.replace('data:', '', 1).strip()
if raw_data == '[DONE]':
print('\nFinal text:', assistant_text)
continue
payload = json.loads(raw_data)
if event_name == 'error' or payload.get('error'):
error = payload.get('error') or payload
raise RuntimeError(error.get('message', 'Chat request failed'))
choices = payload.get('choices') or []
if choices:
delta = choices[0].get('delta') or {}
content = delta.get('content')
if content:
assistant_text += content
print(content, end='', flush=True)
curl -N -X POST "https://api.flaq.ai/api/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: text/event-stream" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.6-luna-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
}'
| 参数 | 价格 | 原价 | 折扣 |
|---|
Flaq AI 上的 GPT 5.6 Luna 图像到文本 API 将快速的 GPT-5.6 处理能力与实用的视觉理解能力相结合,适用于可扩展的应用。通过这项高性价比的 OpenAI 视觉集成,开发者可以使用自然语言指令分析图像、可见文本、布局、图表、产品和场景细节。借助可选文本指引、对话上下文和流式响应,Luna 无需单独部署视觉基础设施,即可支持响应迅速的图像到文本工作流。
注意 请确保您的提示词和上传图像符合 OpenAI 的安全与使用准则。如果发生错误,请检查输入是否包含受限或不支持的内容,简化请求后重试。
GPT 5.6 Luna 对比 GPT 5.6 Sol
GPT 5.6 Sol 面向旗舰级别的高要求视觉推理。GPT 5.6 Luna 则侧重于为生产规模提供速度更快、成本效益更高的图像理解能力。
GPT 5.6 Luna 对比 GPT 5.6 Terra
GPT 5.6 Terra 在专业视觉分析能力与成本之间实现平衡。GPT 5.6 Luna 则优先为重复性图像工作负载提供最快速度和最高效率。
GPT 5.6 Luna 对比 GPT 5.5 图像到文本
GPT 5.5 为现有应用提供可靠的多模态分析能力。GPT 5.6 Luna 则在新一代 GPT 系列中提供速度更快、成本效益更高的选择。
GPT 5.6 Luna 对比 Gemini 视觉模型
Gemini 模型可自然融入以 Google 为中心的多模态系统。GPT 5.6 Luna 则为可扩展视觉分析提供高效的 OpenAI 原生方案。
GPT 5.6 Luna 对比开放视觉模型
开放视觉模型可提供部署灵活性,但需要额外进行服务部署和优化。GPT 5.6 Luna 则通过 Flaq AI 的 API 工作流提供托管式图像理解能力。