Claude Code 指南
設定 Flaq AI Claude 模型並探索 Claude Code 技能
透過 Flaq AI 穩定的 API,使用 Anthropic Claude Fable 5.1 API 分析複雜文件以及 PDF 中的圖表、表格和示意圖,支援複雜知識工作。結合文件脈絡解讀視覺化資訊,為專業分析提供支援。
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: 'claude-fable-5.1-file-analysis',
messages: [
{
role: 'user',
content: [
{ type: 'text', text: 'Summarize this file and extract the key risks.' },
{
type: 'file',
file: {
filename: 'demo.pdf',
file_data: 'https://example.com/demo.pdf'
}
}
]
}
],
stream: true,
max_tokens: 4096
})
});
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': 'claude-fable-5.1-file-analysis',
'messages': [
{
'role': 'user',
'content': [
{'type': 'text', 'text': 'Summarize this file and extract the key risks.'},
{
'type': 'file',
'file': {
'filename': 'demo.pdf',
'file_data': 'https://example.com/demo.pdf',
},
},
],
}
],
'stream': True,
'max_tokens': 4096,
},
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": "claude-fable-5.1-file-analysis",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "Summarize this file and extract the key risks." },
{
"type": "file",
"file": {
"filename": "demo.pdf",
"file_data": "https://example.com/demo.pdf"
}
}
]
}
],
"stream": true,
"max_tokens": 4096
}'
| 參數 | 價格 | 原價 | 折扣 |
|---|
Claude Fable 5.1 檔案分析 API 將 Anthropic 目前的 Fable 級模型應用於 Flaq AI 上的複雜 PDF 與專業文件,尤其擅長處理文件內嵌的圖表、表格與示意圖。透過整合此檔案分析 API,開發者與專業團隊可以從支援的文件、圖片及選用的文字指令中擷取資訊並理解其含義。
注意 上傳的檔案與提示詞須符合 Anthropic 使用政策、Flaq AI 條款及你的資料處理規則。如果發生錯誤,請檢查是否包含不支援或受限制的內容,簡化指令後重試。
Claude Fable 5.1 與 Claude Fable 5 檔案分析比較
Claude Fable 5 檔案分析是上一代 Fable 文件分析模型,對已使用該代模型的團隊仍有價值。當工作重點是 PDF 內嵌的圖表、表格與示意圖時,Claude Fable 5.1 是目前的 Fable 級選擇。
Claude Fable 5.1 與 GPT 6 Astra 檔案分析比較
GPT 6 Astra 檔案分析是 OpenAI 目前的旗艦文件分析模型,適用於複雜推理與跨檔案綜合分析。Claude Fable 5.1 檔案分析 API 則提供 Anthropic 方案,更著重解讀 PDF 內部的視覺結構。
Claude Fable 5.1 與 GPT 5.6 Sol 檔案分析比較
GPT 5.6 Sol 檔案分析是 Flaq AI 上的上一代 OpenAI 旗艦文件分析模型。Claude Fable 5.1 為以文件為主的知識工作提供了目前的 Anthropic 替代選擇,尤其適合重視 PDF 內部圖示的情境。
Claude Fable 5.1 與 Gemini 檔案理解比較
Gemini 檔案工作流程適合以 Google 為核心的多模態產品。Claude Fable 5.1 檔案分析 API 則適用於希望透過 Flaq AI 使用 Anthropic Fable 級文件理解能力的團隊。
設定 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