Claude Code 指南
配置 Flaq AI Claude 模型并探索 Claude Code 技能
免费试用 GPT 5.6 Terra 图生文 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-terra-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-terra-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-terra-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 Terra 图像到文本 API 将均衡的 GPT-5.6 推理能力引入实用的视觉分析工作流。这项高性价比的 OpenAI 视觉集成可帮助开发者通过自然语言指令理解图像、布局、可见文本、图表、产品和场景细节。借助可选的文本指导、对话上下文和流式响应,团队可以构建可扩展的图像到文本功能,在高效的生产应用中兼顾强大的专业能力。
注意 请确保您的提示词和上传的图像符合 OpenAI 的安全与使用准则。如果发生错误,请检查输入是否包含受限制或不受支持的内容,简化请求后重试。
GPT 5.6 Terra 与 GPT 5.6 Sol 对比
GPT 5.6 Sol 以旗舰层级面向要求最高的视觉推理任务。GPT 5.6 Terra 为可扩展的专业图像分析提供了均衡的选择。
GPT 5.6 Terra 与 GPT 5.6 Luna 对比
GPT 5.6 Luna 注重为高吞吐量图像理解提供最快速度和最高成本效益。GPT 5.6 Terra 在效率与更强的日常分析需求之间实现平衡。
GPT 5.6 Terra 与 GPT 5.5 图像到文本对比
GPT 5.5 为成熟应用提供可靠的视觉分析。GPT 5.6 Terra 为迈入新一代 GPT-5.6 系列提供了一条注重成本的路径。
GPT 5.6 Terra 与 Claude 视觉工作流对比
Claude 模型在 Anthropic 生态系统中支持细致的多模态分析。GPT 5.6 Terra 为团队提供了适用于生产级视觉工作流的均衡 OpenAI 原生选择。
GPT 5.6 Terra 与 Gemini 视觉模型对比
Gemini 模型可与以 Google 为中心的产品自然集成。GPT 5.6 Terra 专为偏好 OpenAI 风格视觉推理和 API 集成的团队而设计。