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 为纯文本提示和需要结合图像的提示提供不同接口。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