हमारे शक्तिशाली REST API के साथ OLM OCR को अपने अनुप्रयोगों में एकीकृत करें। कई अपलोड विधियों और लचीले प्रमाणीकरण के लिए समर्थन।
अपने खाते में साइन इन करें और सेटिंग्स पृष्ठ से एक API कुंजी जनरेट करें।
सेटिंग्स पर जाएंबेस64 एन्कोडिंग (छोटी फ़ाइलों के लिए) या URL अपलोड (बड़ी फ़ाइलों के लिए) के बीच चयन करें।
अपनी छवियों या PDF को हमारे OCR API पर भेजें और प्रतिक्रिया में संरचित टेक्स्ट डेटा प्राप्त करें।
छवियों और PDF से टेक्स्ट निकालें
POST https://www.freeolmocr.com/api/ocr/process{
"image": "base64_encoded_image_data",
"options": {
"format": "text" # json, text, markdown
}
}{
"imageUrl": "https://img.freeolmocr.com/mistral-ocr/...",
"options": {
"format": "text" # json, text, markdown
}
}{
"success": true,
"userId": "user_123",
"inputSource": "base64",
"extractedText": "Extracted text content...",
"confidence": 0.95,
"processingTime": 1.2,
"creditsUsed": 1
}अनुरोधों में अपनी API कुंजी शामिल करें
विकल्प 1: x-api-key हेडर
x-api-key: mk_your_api_key_hereविकल्प 2: प्राधिकरण हेडर
Authorization: Bearer mk_your_api_key_hereAI एजेंटों और उपकरणों के लिए मॉडल संदर्भ प्रोटोकॉल
HTTP/JSON-RPC एंडपॉइंट:
POST https://www.freeolmocr.com/api/mcpएसएसई स्ट्रीमिंग एंडपॉइंट:
GET https://www.freeolmocr.com/api/mcpOCR का उपयोग करके दस्तावेज़ों और छवियों से टेक्स्ट निकालें। PDF फ़ाइलों, JPEG, PNG, WebP छवियों का समर्थन करता है। बेस64 डेटा और URL दोनों स्वीकार करता है (समकालिक प्रसंस्करण)
कोड विश्लेषण और छवियों से दस्तावेज़ निष्कर्षण के लिए कर्सर में एमसीपी टूल का उपयोग करें।
MCP कॉन्फ़िगरेशन: cursor_mcp_config.json
{
"mcp": {
"servers": {
"mistral-ocr": {
"url": "https://www.freeolmocr.com/api/mcp",
"transport": "http",
"headers": {
"x-api-key": "mk_your_api_key_here",
"Content-Type": "application/json"
},
"capabilities": { "tools": true }
}
}
},
"shortcuts": {
"ocr": "@mistral-ocr extract_text"
},
"workflows": {
"large_file_ocr": [
"extract_text with public_url"
],
"small_file_ocr": [
"extract_text with base64 data"
]
}
}कर्सर में उपयोग:
@ocrहमारे HTTP/SSE एंडपॉइंट का उपयोग करके अपना खुद का MCP क्लाइंट बनाएं या अन्य AI टूल के साथ एकीकृत करें।
जेनेरिक क्लाइंट कॉन्फ़िगरेशन: mcp_config.json
{
"mcp": {
"servers": {
"mistral-ocr": {
"url": "https://www.freeolmocr.com/api/mcp",
"transport": "http",
"authentication": {
"type": "api_key",
"header": "x-api-key",
"key": "mk_your_api_key_here"
},
"capabilities": {
"tools": true,
"resources": false,
"prompts": false
},
"metadata": {
"name": "Mistral OCR",
"description": "OCR service for PDF and image text extraction",
"version": "2.0.0"
}
}
}
},
"client": {
"timeout": 30000,
"retries": 3,
"transport_fallback": ["http", "sse"]
}
}HTTP क्लाइंट उदाहरण:
// Initialize MCP connection
const response = await fetch('https://www.freeolmocr.com/api/mcp', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'mk_your_api_key'
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'initialize',
params: {
protocolVersion: '2024-11-05',
capabilities: { tools: {} }
}
})
});एसएसई क्लाइंट उदाहरण:
// Connect to SSE endpoint
const eventSource = new EventSource(
'https://www.freeolmocr.com/api/mcp?' +
'api_key=mk_your_api_key'
);
eventSource.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Received:', data);
};सभी MCP अनुरोधों के लिए इनमें से किसी एक विधि का उपयोग करके API कुंजी प्रमाणीकरण की आवश्यकता होती है:
x-api-key: mk_your_api_key (शीर्षक)Authorization: Bearer mk_your_api_key (शीर्षक)FETCH_MCP_SERVER_API_KEY=mk_your_api_key (पर्यावरण चर)curl -X POST https://www.freeolmocr.com/api/mcp \
-H "Content-Type: application/json" \
-H "x-api-key: mk_your_api_key" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}'curl -N -H "Accept: text/event-stream" \
-H "x-api-key: mk_your_api_key" \
https://www.freeolmocr.com/api/mcpउपयोग के लिए तैयार कोड स्निपेट
import requests
import base64
# Base64 method
with open('image.jpg', 'rb') as f:
image_data = base64.b64encode(f.read()).decode()
response = requests.post(
'https://www.freeolmocr.com/api/ocr/process',
headers={'x-api-key': 'mk_your_api_key'},
json={'image': image_data}
)
result = response.json()
print(result['extractedText'])# Base64 method
IMAGE_DATA=$(base64 -i image.jpg)
curl -X POST https://www.freeolmocr.com/api/ocr/process \
-H "x-api-key: mk_your_api_key" \
-H "Content-Type: application/json" \
-d "{\"image\": \"$IMAGE_DATA\"}"हमारे API के साथ तुरंत आरंभ करें या समर्थन के लिए संपर्क करें।