Claude Code 指南
配置 Flaq AI Claude 模型并探索 Claude Code 技能
Gemini 3.5 Flash API 可用于视觉问答、OCR、图像分析和多模态推理。为生产 AI 应用提供稳定访问。适合专业团队在 AI 工作流中处理应用集成、协作交付、场景验证、内容复核、资料整理、业务分析、多步骤任务、产品探索和日常团队迭代,持续构建、测试、验证、优化并改进 AI 功能体验。先测试模型输出并比较视觉质量,再通过稳定图片、视频或多模态 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: 'gemini-3.5-flash-image-to-text',
messages: [
{
role: 'user',
content: [
{ type: 'text', text: 'Describe the image and extract any visible text.' },
{
type: 'image_url',
image_url: {
url: 'https://example.com/sample-image.jpg'
}
}
]
}
],
stream: true,
max_tokens: 2048
})
});
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': 'gemini-3.5-flash-image-to-text',
'messages': [
{
'role': 'user',
'content': [
{'type': 'text', 'text': 'Describe the image and extract any visible text.'},
{
'type': 'image_url',
'image_url': {
'url': 'https://example.com/sample-image.jpg'
}
},
],
}
],
'stream': True,
'max_tokens': 2048,
},
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": "gemini-3.5-flash-image-to-text",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "Describe the image and extract any visible text." },
{
"type": "image_url",
"image_url": {
"url": "https://example.com/sample-image.jpg"
}
}
]
}
],
"stream": true,
"max_tokens": 2048
}'
| 参数 | 价格 | 原价 | 折扣 |
|---|
Flaq AI 上的 Gemini 3.5 Flash 图像生成文本 API 为快速视觉理解、图像分析和多模态推理工作流提供 Google 模型访问能力。这一高效的 Gemini API 集成可帮助开发者通过稳定的托管路由,将上传图像转化为描述、提取细节、答案和结构化摘要。它专为需要响应式图像生成文本能力、但不想构建特定提供商基础设施的团队而设计。
注意 请确保提示、上传图像和应用工作流符合 Google 的安全指南。如果发生错误,请检查输入是否包含受限内容,简化请求后重试。
Gemini 3.5 Flash vs. GPT Image-to-Text
GPT image-to-text 路由提供 OpenAI 原生多模态行为。Gemini 3.5 Flash 为 Flaq AI 上经济高效的视觉理解提供快速 Google 模型路由。
Gemini 3.5 Flash vs. Claude File Analysis
Claude file analysis 擅长细致的文档和附件推理。Gemini 3.5 Flash Image-to-Text 专注于响应式图像理解和视觉 QA。
Gemini 3.5 Flash vs. Grok Image-to-Text
Grok Image-to-Text 为视觉分析提供 xAI 模型行为。Gemini 3.5 Flash 提供具有高效托管 API 访问能力的 Google 替代方案。
Gemini 3.5 Flash vs. Qwen Vision Workflows
Qwen vision workflows 对 Alibaba 模型用户很有吸引力。Gemini 3.5 Flash 非常适合想要快速 Google 图像生成文本集成的团队。
Gemini 3.5 Flash vs. Llama Vision Models
Llama vision models 提供开放模型部署灵活性。Gemini 3.5 Flash 消除托管工作,并为开发者提供稳定的托管路由。