Claude Code 指南
設定 Flaq AI Claude 模型並探索 Claude Code 技能
在 Flaq AI 上使用 xAI 的 Grok 4.7 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: 'grok-4.7',
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,
reasoning_effort: 'medium'
})
});
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;
}
}
}
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': 'grok-4.7',
'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,
'reasoning_effort': 'medium',
},
stream=True,
)
response.raise_for_status()
response.encoding = 'utf-8'
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": "grok-4.7",
"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,
"reasoning_effort": "medium"
}'
| 參數 | 價格 | 原價 | 折扣 |
|---|
透過 Flaq AI 上的 Grok 4.7 API,你可以使用 xAI 的前沿推理模型。Grok 4.7 接收文字與圖片,並以文字回覆。例如,它可以對照介面截圖與錯誤報告分析問題,提出修正建議。Grok 4.7 提供 500,000 個 token 的輸入輸出共用上下文視窗,支援調整推理強度、呼叫工具與串流輸出,適合高難度的軟體工程任務、視覺檢查及複雜的知識工作。
注意 將生成結果用於正式環境的程式碼,或用於法律、醫療、金融及攸關安全的決策前,請先審查。費用依輸入與輸出的 token 數計算,所有請求皆須遵守 xAI 與 Flaq AI 的適用政策。
Grok 4.7 與 Grok 4.6
Flaq AI 上的 Grok 4.6 為純文字提示與需參照圖片的提示提供不同的 API 路徑。Grok 4.7 透過同一個 API 接收文字與圖片輸入,支援調整推理強度及呼叫工具,並提供 500,000 個 token 的共用上下文視窗。
Grok 4.7 與 Claude Sonnet 5.5
Claude Sonnet 5.5 廣泛用於需要細緻處理的長篇寫作與程式設計工作流程。對於評估前沿模型工程能力的團隊,Grok 4.7 提供 xAI 的整合圖文推理介面,可調整推理強度並呼叫工具。
Grok 4.7 與 GPT 6.1 Sol
在 OpenAI 的模型系列中,GPT 6.1 Sol 支援一般用途的文字、視覺與檔案處理工作流程。Grok 4.7 則是 xAI 提供的選擇,著重可調整的推理深度、長共用上下文,以及同時處理文字和圖片的開發工作流程。
Grok 4.7 與 Gemini 3.7 Flash
Gemini 3.7 Flash 著重高速處理文字、圖片與檔案等多模態資料。Grok 4.7 可透過同一個對話 API 接收視覺輸入,適合需要深入推理或大量撰寫程式碼的任務,並可調整推理深度。
Grok 4.7 在 Flaq AI 上的即時參數、支援的輸入和能力。
影片、圖片、LLM、語音和 3D 模型共用一個點數餘額。購買的點數永不過期。如果任務因系統錯誤失敗,餘額不會被扣除。
在 Flaq AI 上使用 xAI 的 Grok 4.7 API,對文字和圖片進行推理。提出視覺問題、分析長對話,並透過同一模型串流接收答案。支援多輪上下文,推理強度可調。
支援的任務:文字轉文字, 圖片轉文字。可用的輸入和設定包括 輸入, 圖片, contextMessages。請查看規格,了解其支援的值。
計費方式:依Token區分,每100 萬輸入 token / 100 萬輸出 token。上方價格表列出了費率及決定適用費率的設定。
如果任務因系統錯誤失敗,餘額不會被扣除。
請在請求中使用 grok-4.7 作為模型 ID。驗證和請求詳情請參閱 API 文件。
其他模型包括 Grok 4 Text to Text, Grok 4 Image to Text, Grok 4.5 Text to Text。可在各模型頁面比較其支援的輸入、輸出設定和價格。
購買的點數不會過期。生成結果的商業使用須遵守 Flaq AI 服務條款及相應模型供應商的條款。
設定 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