Claude Code 指南
配置 Flaq AI Claude 模型并探索 Claude Code 技能
通过 Flaq AI 稳定、实惠的 API 体验 OpenAI GPT 6 Luna API,支持图像理解、图像描述和视觉问答,并支持流式输出。根据图像内容获取说明与回答,为应用中的视觉交互提供支持。
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-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
})
});
if (!response.ok) {
const errorBody = await response.json().catch(() => null);
throw new Error(errorBody?.error?.message ?? errorBody?.message ?? `HTTP ${response.status}`);
}
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(/\r?\n\r?\n/);
buffer = frames.pop() || '';
for (const frame of frames) {
const lines = frame.split(/\r?\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-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-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 6 Luna 图像转文本 API 为图像检查、视觉问答和 OCR 辅助数据提取提供高性价比的 GPT-6 选择。开发者可以在海量视觉工作流和交互式应用中,结合附带的问题分析受支持的图像。
注意 请确保视觉输入和提示消息符合 OpenAI 的安全与使用政策以及 Flaq AI 条款。如果发生错误,请检查图像是否包含不受支持的属性或受限元素,优化提示词后重试。
GPT 6 Luna 图像转文本与 GPT 6 Sol 图像转文本
GPT 6 Sol 图像转文本专为深入的图表解读、复杂架构示意图和高强度多步视觉推理而设计。GPT 6 Luna 图像转文本侧重于快速响应和经济高效的处理,适用于海量视觉标注和实时用户提问。
GPT 6 Luna 图像转文本与 GPT 5.6 Luna 图像转文本
GPT 5.6 Luna 图像转文本是用于高效视觉工作流的较早选择。GPT 6 Luna 图像转文本将更新的 GPT-6 系列引入海量图像问答;迁移前,请使用自己的图像测试视觉准确性与成本。
GPT 6 Luna 图像转文本与专用 OCR 引擎
当转录是主要任务时,专用 OCR 工具很有用。GPT 6 Luna 图像转文本还能回答有关周围视觉上下文的问题,并以文本形式整理所需细节。
GPT 6 Luna 图像转文本与 Gemini Flash 视觉能力
Gemini Flash 模型与 Google Cloud 基础设施紧密集成。GPT 6 Luna 图像转文本提供灵活的 OpenAI 原生视觉解决方案,适配 Flaq AI 上的标准聊天补全格式,价格可预期且经济实惠。
配置 Flaq AI Claude 模型并探索 Claude Code 技能

配置 Flaq AI GPT 模型并探索 Codex 技能
在 Hermes Agent 中使用 Flaq AI LLM 模型
在 ZCode 中使用 GLM 5.2、Kimi K3 和 DeepSeek v4
使用 Flaq AI DeepSeek 模型运行 DeepSeek Harness
将 AI 智能体连接到 Flaq 图像和视频生成工具
在 WorkBuddy 中使用 GPT 6 Astra 和 Claude Fable 5.1