Free to try Grok 4.5 Image-to-Text API powered by X-AI for visual Q&A, OCR, image analysis, and multimodal reasoning through Flaq AI. Explore visual workflows and turn images into actionable insights.
Related Grok 4.5 Models
API Examples
Submit Example
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.5-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);
}
}
}
Submit Example
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.5-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)
Submit Example
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.5-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
}'
Grok 4.5 Image to Text Pricing
| Parameters | Price | Original Price | Discount |
|---|
README
Grok 4.5 Image-to-Text API for Visual Understanding
Grok 4.5 Image-to-Text API provides a focused way to use xAI's multimodal Grok 4.5 model for image understanding through Flaq AI. Submit a supported image with an optional text instruction and receive a text response based on the visual context. The current Flaq AI route is designed for single-image analysis, visual question answering, and image-grounded conversation without implying support for general file attachments or image generation.
Key Features of Grok 4.5 Image-to-Text API
- Image-Grounded Text Responses: Provide an image as context and receive a natural-language response describing or reasoning about visible content.
- Optional Text Instructions: Add a question or task to direct the model toward particular objects, relationships, details, or visible text in the image.
- Single-Image Input Workflow: Use one image per request through the input contract currently exposed by the Flaq AI model configuration.
- Multi-Turn Message Context: Include recent conversation messages for follow-up questions and iterative discussion around the submitted visual context.
- Streaming Response Support: Render text output progressively in chat and analysis interfaces that consume response events.
- Output Length Control: Limit the requested response length to suit concise captions, focused answers, or more detailed analysis.
How to Use Grok 4.5 Image-to-Text API on Flaq AI
- Input: One supported image, with optional text instructions that explain what the model should examine or answer.
- Output: A text response grounded in the submitted image and accompanying message context.
- Context: Recent messages can be supplied to support follow-up questions within the configured conversation window.
- Controls: An optional maximum output length can be set for the generated response.
- Capabilities: Image description, visual question answering, visible-text assistance, and image-grounded analysis through the configured chat interface.
Best Use Cases for Grok 4.5 Image-to-Text API Integration
- Visual Content Review: Generate a first-pass description or summary of a submitted image for editorial and content workflows.
- Image-Based Question Answering: Let users ask targeted questions about objects, scenes, relationships, or visible details in one image.
- Visible Text Assistance: Request transcription or interpretation of readable text while retaining human review for accuracy-critical extraction.
- Product and Asset Triage: Create preliminary descriptions or categorize visual assets based on information visible in the image.
- Accessibility Drafting: Produce draft alt text or image descriptions that editors can review and refine before publishing.
Note Image interpretations and visible-text extraction can be incomplete or inaccurate, particularly with small text, ambiguous scenes, low-quality images, or specialized content. Review important results before use. This route supports one image and does not expose general file input or image generation.
Grok 4.5 Image-to-Text vs Alternatives: Comparative Analysis
-
Grok 4.5 Image-to-Text vs. Grok 4.5 Text-to-Text Image-to-Text accepts visual context and returns text, while Text-to-Text is the more direct choice for requests that contain no image.
-
Grok 4.5 Image-to-Text vs. Dedicated OCR Dedicated OCR systems are purpose-built for deterministic text extraction and document pipelines. Grok 4.5 can discuss visible content and text in context, but it should not be treated as a guaranteed replacement for accuracy-critical OCR.
-
Grok 4.5 Image-to-Text vs. Image Captioning Models Captioning models often target short descriptions. A multimodal chat workflow can also respond to a user-supplied question, though output quality remains dependent on the image and instruction.
-
Grok 4.5 Image-to-Text vs. Other Multimodal LLM APIs Leading multimodal APIs differ in input limits, model behavior, latency, and platform features. Evaluate them with representative images and task-specific acceptance criteria before selecting a provider.
-
Grok 4.5 Image-to-Text vs. Self-Hosted Vision Models Self-hosted vision models provide deployment control but add infrastructure and maintenance work. Flaq AI offers a managed, single-image chat route for teams that prefer hosted Grok 4.5 access.