Claude Code ガイド
Flaq AI の Claude モデルを設定し、Claude Code スキルを探す
PDFのレビュー、画像を認識した文書推論、抽出、要約、安定した本番ワークフローに対応するClaude Sonnet 5ファイル分析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: '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
}'
| パラメータ | 料金 | 元の料金 | 割引 |
|---|
Flaq AI の Claude Sonnet 5 File Analysis API は、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 は、Claude の丁寧な指示追従、持続的な分析、Anthropic エコシステムを重視するチームにとって有力な選択肢です。
Claude Sonnet 5 vs. Gemini File Analysis
Gemini モデルは、Google 中心のマルチモーダルおよび生産性ワークフローに自然に適合します。Claude Sonnet 5 は、詳細な推論、構造化された統合、会話形式のレビューを重視する文書中心のアプリケーションに適しています。
Claude Sonnet 5 vs. オープンモデルの文書パイプライン
オープンモデルはデプロイの制御性とカスタマイズ性を提供できますが、追加のサービングおよび処理インフラが必要です。Claude Sonnet 5 は、Flaq AI の本番環境向け API を通じてマネージドファイル分析を提供します。
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の画像・動画生成ツールに接続