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 Web Search 比較
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 工作流程中結合搜尋依據協助。