คู่มือ Claude Code
ตั้งค่าโมเดล Claude ของ Flaq AI และสำรวจสกิล Claude Code
ทดลอง API วิเคราะห์ไฟล์ Claude Sonnet 5 ฟรีสำหรับตรวจ 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-sonnet-5-file-analysis',
messages: [
{
role: 'user',
content: [
{ type: 'text', text: 'Summarize the key points of this PDF.' },
{
type: 'file',
file: {
filename: 'gptproto.pdf',
file_data: 'https://tos.gptproto.com/resource/gptproto.pdf'
}
}
]
}
],
stream: true,
max_tokens: 1000,
top_p: 0.5,
top_k: 50
})
});
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-sonnet-5-file-analysis',
'messages': [
{
'role': 'user',
'content': [
{'type': 'text', 'text': 'Summarize the key points of this PDF.'},
{
'type': 'file',
'file': {
'filename': 'gptproto.pdf',
'file_data': 'https://tos.gptproto.com/resource/gptproto.pdf'
}
},
],
}
],
'stream': True,
'max_tokens': 1000,
'top_p': 0.5,
'top_k': 50,
},
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-sonnet-5-file-analysis",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "Summarize the key points of this PDF." },
{
"type": "file",
"file": {
"filename": "gptproto.pdf",
"file_data": "https://tos.gptproto.com/resource/gptproto.pdf"
}
}
]
}
],
"stream": true,
"max_tokens": 1000,
"top_p": 0.5,
"top_k": 50
}'
| พารามิเตอร์ | ราคา | ราคาเดิม | ส่วนลด |
|---|
Claude Sonnet 5 File Analysis API บน Flaq AI นำความสามารถขั้นสูงของ Anthropic ด้านการให้เหตุผล การเขียนโค้ด และงานความรู้มาสู่แอปพลิเคชันที่เน้นเอกสาร การผสาน Claude API ที่พร้อมใช้งานจริงนี้ช่วยให้นักพัฒนารวมคำสั่งภาษาธรรมชาติเข้ากับไฟล์และรูปภาพที่รองรับ เพื่อสรุป แยกข้อมูล เปรียบเทียบ และวิเคราะห์เชิงลึก ด้วยอินพุตหลายไฟล์ การถามต่อแบบสนทนา การตอบกลับแบบสตรีม และการควบคุมการสร้างที่ยืดหยุ่น ทีมจึงเปลี่ยนแหล่งข้อมูลที่ซับซ้อนให้เป็นคำตอบที่เป็นประโยชน์ได้โดยไม่ต้องสร้างโครงสร้างพื้นฐานสำหรับประมวลผลเอกสารแยกต่างหาก
หมายเหตุ โปรดตรวจสอบว่าพรอมต์ ไฟล์ที่อัปโหลด และเวิร์กโฟลว์แอปพลิเคชันของคุณเป็นไปตามแนวทางด้านความปลอดภัยและการใช้งานของ Anthropic หากเกิดข้อผิดพลาด ให้ตรวจสอบอินพุตว่ามีเนื้อหาที่ถูกจำกัดหรือไม่รองรับหรือไม่ ลดความซับซ้อนของคำขอ แล้วลองอีกครั้ง
Claude Sonnet 5 vs. Claude Sonnet 4.6 File Analysis
Claude Sonnet 4.6 รองรับการให้เหตุผลเกี่ยวกับเอกสารและการวิเคราะห์ระดับมืออาชีพที่เชื่อถือได้ Claude Sonnet 5 พัฒนาต่อยอดพื้นฐานดังกล่าวด้วยประสิทธิภาพด้านการทำงาน การให้เหตุผล การเขียนโค้ด และงานความรู้ที่แข็งแกร่งยิ่งขึ้นสำหรับเวิร์กโฟลว์ไฟล์ที่มีความต้องการสูง
Claude Sonnet 5 vs. Claude Opus 4.8 File Analysis
Claude Opus 4.8 มุ่งเน้นเวิร์กโหลดที่ให้ความสำคัญกับระดับความสามารถสูงสุดของ Anthropic ส่วน Claude Sonnet 5 เป็นตัวเลือกระดับ Sonnet สำหรับการวิเคราะห์ไฟล์ที่ปรับขนาดได้ พร้อมสมดุลด้านต้นทุนและประสิทธิภาพที่เหมาะสมกว่า
Claude Sonnet 5 vs. GPT 5.5 File Analysis
GPT 5.5 มีเวิร์กโฟลว์เอกสารและหลายรูปแบบขั้นสูงของ OpenAI ส่วน Claude Sonnet 5 เป็นทางเลือกที่แข็งแกร่งสำหรับทีมที่ให้ความสำคัญกับการปฏิบัติตามคำสั่งอย่างรอบคอบ การวิเคราะห์อย่างต่อเนื่อง และระบบนิเวศของ Anthropic
Claude Sonnet 5 vs. Gemini File Analysis
โมเดล Gemini เหมาะกับเวิร์กโฟลว์แบบหลายรูปแบบและการทำงานที่เน้น Google โดยธรรมชาติ ส่วน Claude Sonnet 5 เหมาะสำหรับแอปพลิเคชันที่ใช้เอกสารจำนวนมากและให้ความสำคัญกับการให้เหตุผลโดยละเอียด การสังเคราะห์แบบมีโครงสร้าง และการตรวจสอบแบบสนทนา
Claude Sonnet 5 vs. ไปป์ไลน์เอกสารแบบโมเดลเปิด
โมเดลเปิดช่วยให้ควบคุมและปรับแต่งการติดตั้งใช้งานได้ แต่ต้องมีโครงสร้างพื้นฐานเพิ่มเติมสำหรับให้บริการและประมวลผล Claude Sonnet 5 ให้บริการวิเคราะห์ไฟล์แบบมีการจัดการผ่าน API ที่ออกแบบเพื่อการใช้งานจริงบน Flaq AI
ตั้งค่าโมเดล Claude ของ Flaq AI และสำรวจสกิล Claude Code

ตั้งค่าโมเดล GPT ของ Flaq AI และสำรวจสกิล Codex
ใช้โมเดล LLM ของ Flaq AI ใน Hermes Agent
ใช้ GLM 5.2, Kimi K3 และ DeepSeek v4 ใน ZCode
เรียกใช้ DeepSeek Harness กับโมเดล DeepSeek ของ Flaq AI
เชื่อมต่อเอเจนต์ AI กับเครื่องมือสร้างรูปภาพและวิดีโอของ Flaq