by Baidu
Document OCR (Baidu Unlimited-OCR, open weights), self-hosted in a TEE: turns page images into text with layout. Not a chat model, and it does not read a PDF file: render its pages to images first. One page: send the image with the text "<image>document parsing." and vllm_xargs: {ngram_size: 35, window_size: 128}. Several pages: put every page image in one message with the text "<image>Multi page parsing." and window_size 1024; pages come back separated by <PAGE> (with the one-page text only the first page is read). Several pages are read at a lower resolution, so send dense pages one per request. Always set skip_special_tokens: false.
33K
32,768 tokens
8K
8,192 tokens
$0.1
per 1M tokens
$0.4
per 1M tokens
IMAGE=$(base64 < page.png | tr -d '\n')
curl "https://router-api.0g.ai/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-d @- <<EOF
{
"model": "unlimited-ocr",
"messages": [
{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": "data:image/png;base64,${IMAGE}"}},
{"type": "text", "text": "<image>document parsing."}
]}
],
"skip_special_tokens": false,
"vllm_xargs": {"ngram_size": 35, "window_size": 128}
}
EOFTEE Verification
Request on-chain signature verification with verify_tee. The response includes a tee_verified field in the trace.
{
"model": "unlimited-ocr",
"messages": [{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": "data:image/png;base64,<PAGE_IMAGE>"}},
{"type": "text", "text": "<image>document parsing."}
]}],
"skip_special_tokens": false,
"vllm_xargs": {"ngram_size": 35, "window_size": 128},
"verify_tee": true
}Provider Routing
Control which provider handles your request using the X-0G-Provider-* request headers.
X-0G-Provider-Address pins a provider; X-0G-Provider-Identity pins which of its upstreams to route through — both values come from the address and provider_identity fields of GET /v1/providers. Together they address one specific upstream of one provider. Send neither and the router picks by price and health, exactly as before.
curl "https://router-api.0g.ai/v1/chat/completions" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-H "X-0G-Provider-Address: <PROVIDER_ADDRESS>" \
-H "X-0G-Provider-Identity: <UPSTREAM>" \
-H "X-0G-Provider-Sort: latency" \
-H "X-0G-Provider-Allow-Fallbacks: true" \
-d '{
"model": "unlimited-ocr",
"messages": [{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": "data:image/png;base64,<PAGE_IMAGE>"}},
{"type": "text", "text": "<image>document parsing."}
]}],
"skip_special_tokens": false,
"vllm_xargs": {"ngram_size": 35, "window_size": 128}
}'Private models only
This model is Private. To pin requests to a TEE-backed provider, add the X-0G-Provider-Trust-Mode: private header. Opt-in — not applied by default.
X-0G-Provider-Trust-Mode: private