Hướng dẫn Claude Code
Thiết lập model Claude của Flaq AI và khám phá kỹ năng Claude Code
API Claude Sonnet 4.6 cho suy luận tài liệu trên PDF, báo cáo, hợp đồng và hỏi đáp tệp. Truy cập Claude ổn định, chi phí hợp lý cho sản xuất. Dùng API GPT, Claude và các LLM ổn định cho AI agent, chatbot, nghiên cứu, lập trình, tự động hóa và ứng dụng thông minh.
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-4.6-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,
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-4.6-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,
'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-4.6-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,
"top_p": 0.5,
"top_k": 50
}'
| Tham số | Giá | Giá gốc | Giảm giá |
|---|
Claude Sonnet 4.6 File Analysis API trên Flaq AI cung cấp quyền truy cập Claude API cho các workflow production cần tốc độ cân bằng, phân tích cẩn trọng và khả năng làm theo hướng dẫn đáng tin cậy. Tích hợp Claude API nhanh, mạnh và sẵn sàng cho production này giúp nhà phát triển xây dựng trải nghiệm file analysis với ngữ cảnh hội thoại linh hoạt, prompting theo tài liệu, workflow công cụ được hỗ trợ và thiết lập theo route trên Flaq AI. Được xây dựng cho tải production, nó mang lại cho đội ngũ một cách ổn định để thêm năng lực AI nâng cao mà không cần quản lý hạ tầng mô hình hay viết phần kết nối riêng cho từng provider từ đầu.
Lưu ý Hãy đảm bảo prompt, tệp tải lên và workflow ứng dụng tuân thủ hướng dẫn an toàn và sử dụng của Anthropic. Nếu xảy ra lỗi, hãy kiểm tra input để tìm nội dung bị hạn chế, đơn giản hóa yêu cầu rồi thử lại.
Claude Sonnet 4.6 vs. GPT 5.5 GPT 5.5 được định vị cho suy luận OpenAI nâng cao và workflow coding. Claude Sonnet 4.6 nổi bật nhờ khả năng làm theo hướng dẫn kiểu Claude, phân tích cẩn trọng và phù hợp mạnh với workflow viết, tệp và agent.
Claude Sonnet 4.6 vs. GPT 5.4 GPT 5.4 nhấn mạnh hiệu năng OpenAI tiết kiệm cho công việc chuyên nghiệp. Claude Sonnet 4.6 cung cấp lựa chọn Claude API thay thế với chất lượng phản hồi cẩn trọng, điều khiển thực tế và output đáng tin cậy cho tác vụ file analysis.
Claude Sonnet 4.6 vs. Gemini Mô hình Gemini mạnh cho use case đa phương thức native Google. Claude Sonnet 4.6 khác biệt nhờ phong cách phản hồi cẩn trọng của Claude, suy luận tài liệu thực tế và hành vi công cụ hướng production.
Claude Sonnet 4.6 vs. DeepSeek Reasoner DeepSeek Reasoner hữu ích cho workload suy luận nhạy cảm về chi phí. Claude Sonnet 4.6 cung cấp chất lượng Claude được quản lý, hành vi production an toàn hơn và độ phù hợp cao hơn cho workflow viết, coding và phân tích chuyên nghiệp.
Claude Sonnet 4.6 vs. Llama Mô hình Llama cho nhà phát triển quyền kiểm soát open-model và linh hoạt self-hosting. Claude Sonnet 4.6 phù hợp hơn với đội ngũ muốn API được quản lý, khả năng làm theo hướng dẫn mạnh và output chất lượng cao mà không cần vận hành hạ tầng mô hình.
Thiết lập model Claude của Flaq AI và khám phá kỹ năng Claude Code

Thiết lập model GPT của Flaq AI và khám phá kỹ năng Codex
Dùng mô hình LLM của Flaq AI trong Hermes Agent
Sử dụng GLM 5.2, Kimi K3 và DeepSeek v4 trong ZCode
Chạy DeepSeek Harness với các mô hình DeepSeek của Flaq AI
Kết nối các tác nhân AI với công cụ tạo hình ảnh và video của Flaq