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-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
})
});
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-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-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 6 Luna Web Search API 結合具成本效益的 GPT-6 模型與網路檢索,提供有來源依據的回答,並支援具時效性的研究。這項網路搜尋 API 整合專為大量客戶查詢、新聞資訊流及市場監測打造,協助開發者檢索公開資訊、比較來源,並彙整結果以供審閱。
注意 請確保提示詞、附件素材及檢索任務符合 OpenAI 使用政策、Flaq AI 條款及適用的網站服務條款。如果發生錯誤,請縮小查詢範圍,移除受限制的詞語或附件,然後重試。
GPT 6 Luna Web Search 與 GPT 6 Sol Web Search
GPT 6 Sol Web Search 適合需要對公開來源進行較長篇幅比較的工作流程。GPT 6 Luna Web Search 則定位於目標明確、對成本敏感的大量查詢。
GPT 6 Luna Web Search 與 GPT 5.6 Luna Web Search
GPT 5.6 Luna Web Search 是較早推出、用於產生有搜尋依據的回答的選項。GPT 6 Luna Web Search 將更新的 GPT-6 系列引入目標明確的研究查詢;遷移前,請使用自己的查詢比較來源相關性與回答品質。
GPT 6 Luna Web Search 與搜尋優先的問答引擎
搜尋優先的問答引擎往往傳回固定形式的摘要片段及大量引用連結。GPT 6 Luna Web Search 則依照使用者的提示詞格式與系統指令,直接提供連貫、自然的對話式綜合回答。
GPT 6 Luna Web Search 與 Gemini 以搜尋為依據的回答
Gemini 以搜尋為依據提供回答的模型圍繞 Google 搜尋生態系設計。GPT 6 Luna Web Search 提供 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