Claude Code Guide
Set up Flaq AI Claude models and explore Claude Code skills
Try Claude Sonnet 5.5 API by Anthropic for document review, summaries, and file Q&A through Flaq AI's stable, affordable API with streaming responses for apps.
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.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,
})
});
if (!response.ok) {
const errorBody = await response.json().catch(() => null);
throw new Error(errorBody?.error?.message ?? errorBody?.message ?? `HTTP ${response.status}`);
}
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(/\r?\n\r?\n/);
buffer = frames.pop() || '';
for (const frame of frames) {
const lines = frame.split(/\r?\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.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,
},
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.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
}'
| Parameters | Price | Original Price | Discount |
|---|
Claude Sonnet 5.5 File Analysis API helps developers turn uploaded reference material into useful written answers on Flaq AI. Combine documents or images with a question to request summaries, explanations, and comparisons based on the supplied content. The message-based interface, streaming delivery, and adjustable output length support document assistants and research workflows that need to move from source files to a readable response.
Document-Centered Questions: Ask focused questions about supplied documents instead of manually copying every relevant passage into a text-only conversation.
Flexible Reference Input: Combine supported files, an image, and text instructions to provide the material needed for a document review task.
Summary and Extraction Workflows: Request an overview, key points, or selected information from the supplied material, specifying the output format in the prompt.
Cross-Document Review: Provide related files and ask the model to identify shared themes, differences, or points that need closer inspection.
Conversational Follow-Ups: Carry relevant messages forward to refine a summary or ask for an explanation of a particular finding.
Streaming and Length Controls: Display generated analysis progressively and set an output token limit appropriate to the requested depth.
Input: Supported document or image attachments, together with optional text instructions and relevant messages.
Output: Written analysis, summaries, or answers, with streamed and non-streamed response options.
Controls: Guide the analysis with a specific question, a requested format, and an optional output token limit.
Capabilities: Document question answering, summarization, information extraction, and comparison of supplied reference material.
Report Review: Ask for a concise overview of an uploaded report and follow up on the sections relevant to your team.
Research Reading: Compare supplied papers or reference documents and organize their main points into a working brief.
Project Handoffs: Turn attached specifications and notes into a summary of requirements and unresolved questions.
Knowledge Assistants: Let users query uploaded reference files from a conversational interface.
Editorial Preparation: Extract themes and supporting details from source documents before drafting an article or presentation.
Note Use readable source files and identify the question you want answered. Check quotations, numbers, and conclusions against the original material before relying on the analysis.
Claude Sonnet 5.5 File Analysis vs. GPT 6.1 Sol File Analysis Both Flaq AI routes accept files and images for written analysis. Evaluate them on the same source documents and questions to compare relevance, completeness, and interpretation.
Claude Sonnet 5.5 File Analysis vs. Claude Sonnet 5.5 Text-to-Text Text-to-Text works with source material supplied directly in messages. File Analysis is the attachment-enabled option for document-centered tasks.
Claude Sonnet 5.5 File Analysis vs. GPT 6.1 Sol Image-to-Text Image-to-Text focuses on visual questions and does not enable document attachments in its Flaq AI configuration. File Analysis supports workflows built around uploaded files as well as images.
Claude Sonnet 5.5 File Analysis vs. GPT 6.1 Sol Web Search Web Search addresses online research, while this Claude route reviews supplied material without web search. Choose according to where the evidence for the answer should come from.
Set up Flaq AI Claude models and explore Claude Code skills

Set up Flaq AI GPT models and explore Codex skills
Use Flaq AI LLM models in Hermes Agent
Use GLM 5.2, Kimi K3, and DeepSeek v4 in ZCode
Run DeepSeek Harness with Flaq AI DeepSeek models
Connect AI agents to Flaq image and video generation tools
Use GPT 6 Astra and Claude Fable 5.1 in WorkBuddy