Claude Code 指南
配置 Flaq AI Claude 模型并探索 Claude Code 技能
免费试用 GPT 5.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-5.6-luna-web-search',
messages: [
{
role: 'user',
content: 'Find the latest public information about Flaq AI and summarize it for a product brief.'
}
],
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-web-search',
'messages': [
{
'role': 'user',
'content': 'Find the latest public information about Flaq AI and summarize it for a product brief.',
}
],
'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-web-search",
"messages": [
{
"role": "user",
"content": "Find the latest public information about Flaq AI and summarize it for a product brief."
}
],
"stream": true,
"max_tokens": 2048
}'
| 参数 | 价格 | 原价 | 折扣 |
|---|
Flaq AI 上的 GPT 5.6 Luna 网页搜索 API 将 OpenAI 速度最快的 GPT-5.6 模型与访问当前公开网络信息的能力相结合。这项高性价比的搜索集成可帮助开发者构建响应迅速的研究、监测、验证和内容工作流,满足大规模获取最新上下文的需求。借助对话式后续交互和对相关多模态输入的支持,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 5.6 Luna 对比 Gemini 搜索工作流
Gemini 搜索体验与 Google 生态系统自然契合。GPT 5.6 Luna 则为可扩展的网络研究提供高效的 OpenAI 原生方案。
GPT 5.6 Luna 对比传统搜索流程
传统流程需要独立的检索、排序和综合处理组件。GPT 5.6 Luna 则通过托管式 Flaq AI API 工作流整合基于搜索的协助能力。