Claude Code 指南
設定 Flaq AI Claude 模型並探索 Claude Code 技能
透過 Flaq AI 穩定、實惠且支援串流輸出的 API,體驗 OpenAI GPT 6.1 Sol 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.1-sol-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.1-sol-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.1-sol-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
}'
| 參數 | 價格 | 原價 | 折扣 |
|---|
GPT 6.1 Sol Web Search API 在 Flaq AI 上支援結合搜尋的問答與研究工作流程。提供研究主題、 所需資訊以及相關背景,即可請求能夠使用網頁搜尋的文字回答。此路由 將訊息式互動與選用的輔助附件、串流回應和可調整的輸出 長度結合,適用於需要處理線上資訊的應用程式。
網頁搜尋能力: 對於需要查找超出對話中已提供背景資訊的問題, 可使用支援搜尋的路由。
提示詞引導的研究: 指定研究主題、時間區間與預期範圍,讓請求聚焦於 應用程式所需的資訊。
輔助參考輸入: 在文字問題中附加支援的檔案或圖片,為研究 任務提供更多背景。
對話式細化: 透過追問縮小主題範圍,或要求對 先前回答作出更清楚的解釋。
串流研究回應: 逐步傳回產生的文字,提供互動式研究體驗。
可調整的回答長度: 設定輸出 token 上限,並說明需要簡潔概述還是 更充分展開的回答。
輸入: 文字形式的研究問題、相關對話背景,以及選用的支援圖片或檔案 附件。
輸出: 透過支援網頁搜尋的模型路由產生的文字回答。
控制項: 提示詞中的研究範圍、選用的輸出 token 上限,以及是否使用串流回應。
能力: 結合搜尋的問答、線上研究摘要,以及對某個主題的後續探索。
研究助理: 協助使用者調查主題,並細化希望探索的問題。
產品研究: 為產品比較簡報蒐集資訊,並在 作出決策前核查原始來源。
產業簡報: 請求針對指定主題和時間區間內發展動態的重點概述。
文件查找: 查找與技術問題相關的資訊,並對照原始 文件進行核實。
結合背景的調查: 將上傳的參考資料與需要額外線上 資訊的問題結合。
注意 請說明相關日期範圍,並在採用研究回答前核查來源日期與原始頁面。 能夠存取網頁並不保證每個相關頁面都可用,也不保證傳回的所有陳述都是最新的。
GPT 6.1 Sol Web Search 與 GPT 6.1 Sol Text-to-Text Text-to-Text 處理已提供的訊息,不使用網頁搜尋。 Web Search 路由則針對需要線上資訊的問題進行設定。
GPT 6.1 Sol Web Search 與 GPT 6.1 Sol File Analysis File Analysis 以使用者上傳的材料為核心。Web Search 支援超出這些附件範圍的研究,同時保留選用的參考輸入。
GPT 6.1 Sol Web Search 與 GPT 6.1 Sol Image-to-Text Image-to-Text 著重於描述已提供的圖片,或回答 與圖片有關的問題。Web Search 處理文字研究問題,並可將圖片用作輔助背景。
GPT 6.1 Sol Web Search 與 Claude Sonnet 5.5 File Analysis Claude 的 File Analysis 設定接受文件 和圖片,但不啟用網頁搜尋。當任務也仰賴線上材料時, 此 GPT 路由提供支援搜尋的選項。
設定 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