Claude Code 指南
設定 Flaq AI Claude 模型並探索 Claude Code 技能
免費試用 GPT 5.6 Terra 網路搜尋 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-terra-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-terra-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-terra-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 Terra 網頁搜尋 API,結合平衡的 GPT-5.6 推理能力與目前公開網路資訊的存取。這項具成本效益的 OpenAI 搜尋整合,可協助開發者為市場監測、事實查核、時事摘要與專業知識工作流程建立研究工具。透過對話上下文與相關多模態輸入支援,Terra 為持續的正式環境使用提供實用的搜尋依據型 API。
注意 請確保提示、上傳的輸入與應用程式工作流程符合 OpenAI 的安全與使用準則。若發生錯誤,請檢查輸入是否包含受限制內容、簡化請求,然後再試一次。
GPT 5.6 Terra 與 GPT 5.6 Sol
GPT 5.6 Sol 適合需要旗艦級推理深度的複雜調查。GPT 5.6 Terra 則為廣泛的專業網頁研究提供平衡且成本較低的選擇。
GPT 5.6 Terra 與 GPT 5.6 Luna
GPT 5.6 Luna 優先提供快速且高度有效率的搜尋依據型回應。GPT 5.6 Terra 則為持續研究與綜合任務提供更全面的平衡。
GPT 5.6 Terra 與 GPT 5.5 Web Search
GPT 5.5 支援可靠的目前資訊工作流程。GPT 5.6 Terra 則提供具成本意識的方式來使用新一代 GPT 系列的搜尋能力。
GPT 5.6 Terra 與 Claude 搜尋工作流程
Claude 模型在 Anthropic 生態系中提供謹慎的研究與綜合能力。GPT 5.6 Terra 為搜尋依據型應用提供平衡的 OpenAI 原生替代方案。
GPT 5.6 Terra 與 Gemini 搜尋工作流程
Gemini 搜尋體驗與 Google 生態系緊密配合。GPT 5.6 Terra 適合將 OpenAI 風格 API 工作流程標準化的團隊。