Claude Code 指南
設定 Flaq AI Claude 模型並探索 Claude Code 技能
透過 Flaq AI 穩定、實惠且支援串流回應的 API,體驗 OpenAI GPT 6.1 Sol 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: 'gpt-6.1-sol-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
})
});
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': 'gpt-6.1-sol-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": "gpt-6.1-sol-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
}'
| 參數 | 價格 | 原價 | 折扣 |
|---|
GPT 6.1 Sol 圖像轉文字 API 在 Flaq AI 上將視覺輸入與文字回應相連結。提供一張圖片,並在需要時附上 問題,即可請求圖片描述、可見內容的解釋,或針對特定細節的回答。 開發者可以在圖片審閱工具、內容工作流程和對話產品中使用這項視覺理解 API, 並使用串流輸出和可調整的回應長度。
根據圖片提問: 透過自然語言指令,將注意力引導到圖片中的特定物件、關係 或區域。
描述性文字輸出: 請求對可見內容的文字描述,用於審閱、索引或 編輯準備。
可選提示詞引導: 加入問題或格式要求,讓回應圍繞工作流程所需的 資訊展開。
聚焦視覺審閱: 詢問構圖、可見物件或圖片中可辨讀的內容,而無需將 請求變成圖片生成任務。
串流回答: 在對話或審閱介面中逐步呈現文字回應。
彈性控制回應範圍: 設定輸出 token 上限,並請求簡短圖說或更詳細的解釋。
輸入: 一張受支援的圖片,可選擇附上文字問題或指令。
輸出: 針對所提供視覺內容的文字描述、解釋或回答。
控制選項: 透過提示詞指定關注重點、可選的輸出 token 上限,以及串流或非串流回應。
能力: 視覺問答、圖片描述,以及對圖片可見內容的文字審閱。
圖片編目: 為一組產品圖片或編輯用圖準備描述性文字,並在發布前 進行審閱。
無障礙描述草稿: 生成初步圖片描述,供編輯核查,並根據周圍 內容進行調整。
視覺審閱助手: 讓使用者針對所提供的照片或螢幕截圖提問。
創意分析: 請求對構圖和可見細節的觀察,為設計討論提供參考。
內容準備: 將視覺參考轉化為圖說或創作簡報的文字初稿。
注意 請使用清晰的圖片並提出有針對性的問題。對小字的辨讀、細微細節和推斷性描述, 請對照原圖核查;此介面傳回文字,而非編輯後的圖片或生成的圖片。
GPT 6.1 Sol 圖像轉文字與 GPT 6.1 Sol 文字生成 文字生成接收不含圖片 附件的文字訊息。對於必須使用圖片本身的任務,圖像轉文字是對應的視覺輸入介面。
GPT 6.1 Sol 圖像轉文字與 GPT 6.1 Sol 檔案分析 檔案分析既支援文件附件,也支援 圖片輸入。圖像轉文字將工作流程聚焦於視覺材料,其在 Flaq AI 上的設定 不接受檔案附件。
GPT 6.1 Sol 圖像轉文字與 Claude Sonnet 5.5 檔案分析 Claude 的檔案分析介面除文件外,也可以接收 圖片。在以圖片為重點和以文件為導向的工作流程之間進行選擇時,可使用具代表性的視覺材料 比較回應。
GPT 6.1 Sol 圖像轉文字與 GPT 6.1 Sol 網路搜尋 網路搜尋面向線上研究,並可接受 輔助附件。圖像轉文字處理所提供的視覺內容,不啟用網路搜尋。
設定 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 圖片和影片生成工具
在 WorkBuddy 中使用 GPT 6 Astra 和 Claude Fable 5.1