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개
8K
토큰 8,192개
$0.1
100만 토큰당
$0.4
100만 토큰당
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 인증
verify_tee로 온체인 서명 인증을 요청하세요. 응답에는 trace에 tee_verified 필드가 포함됩니다.
{
"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
}제공자 라우팅
X-0G-Provider-* 요청 헤더를 사용하여 요청을 처리할 제공자를 제어합니다.
X-0G-Provider-Address는 제공자를 고정하고, X-0G-Provider-Identity는 해당 제공자의 업스트림 중 어느 것을 통해 라우팅할지 고정합니다. 두 값 모두 GET /v1/providers의 address 및 provider_identity 필드에서 가져옵니다. 이 둘을 함께 사용하면 특정 제공자의 특정 업스트림 하나를 지정합니다. 둘 다 보내지 않으면 라우터는 이전과 똑같이 가격과 상태에 따라 선택합니다.
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}
}'비공개 모델 전용
이 모델은 비공개입니다. 요청을 TEE 지원 제공자로 고정하려면 X-0G-Provider-Trust-Mode: private 헤더를 추가하세요. 옵트인 방식이며 기본적으로 적용되지 않습니다.
X-0G-Provider-Trust-Mode: private