Claude Code Guide
Set up Flaq AI Claude models and explore Claude Code skills
Use the Grok 4.7 API by xAI on Flaq AI to reason over text and images. Ask visual questions, analyze long conversations, and stream text answers over SSE with one model.
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"
}'
| Parameters | Price | Original Price | Discount |
|---|
Grok 4.7 API brings xAI's frontier reasoning model to Flaq AI. Grok 4.7 accepts text and images and returns text—for example, it can review a UI screenshot alongside a bug report and suggest a fix. With a 500,000-token shared context window, configurable reasoning effort, tool calling, and streaming output, Grok 4.7 is built for demanding software engineering, visual inspection, and complex knowledge work.
Note Review generated outputs before applying them to production code, legal, medical, financial, or safety-critical decisions. Usage is billed by input and output tokens, and all requests must comply with applicable xAI and Flaq AI policies.
Grok 4.7 vs. Grok 4.6
Grok 4.6 offers separate routes on Flaq AI for text-only and image-grounded prompts. Grok 4.7 accepts both text and image inputs through a single API and supports configurable reasoning effort, tool calling, and a 500,000-token shared context window.
Grok 4.7 vs. Claude Sonnet 5.5
Claude Sonnet 5.5 is widely used for careful long-form writing and coding workflows. Grok 4.7 offers xAI's unified text-and-image reasoning interface with adjustable reasoning effort and tool calling for teams evaluating frontier engineering performance.
Grok 4.7 vs. GPT 6.1 Sol
GPT 6.1 Sol supports general-purpose text, vision, and file workflows across OpenAI's lineup. Grok 4.7 provides a focused xAI option centered on configurable reasoning depth, long shared context, and mixed text-and-image developer workflows.
Grok 4.7 vs. Gemini 3.7 Flash
Gemini 3.7 Flash emphasizes high-speed multimodal processing across text, images, and files. Grok 4.7 targets deeper configurable reasoning and coding-intensive tasks alongside visual input within a single conversational API.
Live parameters, supported inputs, and capabilities for Grok 4.7 on Flaq AI.
Try the model in the Playground before making an API request.
Use one credit balance across video, image, LLM, voice, and 3D models. Purchased credits never expire. If a task fails due to a system error, your balance is not deducted.
Copy the model ID below into your API request for Grok 4.7.
Explore other models from xAI and check their supported inputs and pricing.
Everything you need to know about capabilities, pricing, failed tasks, and API usage.
Use the Grok 4.7 API by xAI on Flaq AI to reason over text and images. Ask visual questions, analyze long conversations, and stream text answers over SSE with one model.
Supported tasks: Text To Text, Image To Text. Available inputs and settings include Input, Image, contextMessages. See the specifications for their supported values.
Billing model: Per 1M input tokens / 1M output tokens by Token. The pricing table above lists rates and the settings that determine which rate applies.
If a task fails due to a system error, your balance will not be deducted.
Use grok-4.7 as the model ID in your request. Refer to the API documentation for authentication and request details.
Other models include Grok 4 Text to Text, Grok 4 Image to Text, Grok 4.5 Text to Text. Compare their supported inputs, output settings, and pricing on their model pages.
Purchased credits do not expire. Commercial use of outputs is subject to Flaq AI’s terms of service and the applicable model provider’s terms.
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