{"openapi":"3.1.0","info":{"title":"ocrarena","description":"OCR inference benchmark service with PP-OCRv6 support","version":"0.1.0"},"paths":{"/v1/paddle/ocrv6/report":{"post":{"tags":["paddle-ocrv6"],"summary":"Run PP-OCRv6 on an uploaded image file or an image URL","description":"Accepts `multipart/form-data`. Provide exactly one of `file` (an uploaded image) or `image_url` (a publicly accessible URL). Detection/recognition tuning is fixed in app/api/v1/endpoints/paddle_ocrv6_config.py; `model_size` may still be overridden per request for benchmarking.","operationId":"create_ocr_report_v1_paddle_ocrv6_report_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_ocr_report_v1_paddle_ocrv6_report_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OcrReport"}}}},"422":{"description":"Image doesn't look like a receipt"},"500":{"description":"Inference failed"},"400":{"description":"Provide exactly one of file or image_url"},"413":{"description":"Image exceeds the size limit"},"502":{"description":"Failed to download image_url"}}}},"/v1/paddle/ocrv6/ui":{"get":{"tags":["paddle-ocrv6"],"summary":"Interactive PP-OCRv6 demo page","operationId":"ocr_demo_page_v1_paddle_ocrv6_ui_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"text/html":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"text/html":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/health":{"get":{"tags":["meta"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"Body_create_ocr_report_v1_paddle_ocrv6_report_post":{"properties":{"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File","description":"Image file (png/jpeg/webp/bmp/tiff). Provide this XOR image_url."},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url","description":"Publicly accessible image URL. Provide this XOR file."},"model_size":{"anyOf":[{"type":"string","enum":["tiny","small","medium"]},{"type":"null"}],"title":"Model Size","description":"Override the configured PP-OCRv6 variant for this request (for benchmarking)."}},"type":"object","title":"Body_create_ocr_report_v1_paddle_ocrv6_report_post"},"ErrorResponse":{"properties":{"error":{"type":"string","title":"Error"},"detail":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["error"],"title":"ErrorResponse"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status","default":"ok"},"version":{"type":"string","title":"Version","default":"0.1.0"}},"type":"object","title":"HealthResponse"},"OcrReport":{"properties":{"source":{"type":"string","title":"Source","description":"Origin of the image (filename or URL)"},"text_count":{"type":"integer","minimum":0.0,"title":"Text Count"},"avg_confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Avg Confidence"},"min_confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Min Confidence"},"max_confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Max Confidence"},"full_text":{"type":"string","title":"Full Text","description":"All recognized text joined by newlines"},"results":{"items":{"$ref":"#/components/schemas/OcrTextResult"},"type":"array","title":"Results"},"latency_ms":{"type":"number","minimum":0.0,"title":"Latency Ms","description":"End-to-end inference latency in milliseconds"},"backend":{"type":"string","title":"Backend"},"model":{"type":"string","title":"Model"},"receipt_detected":{"type":"boolean","title":"Receipt Detected","description":"Whether the receipt-boundary pre-crop found and isolated a receipt in the frame"},"receipt_boundary":{"anyOf":[{"items":{"items":{"type":"number"},"type":"array"},"type":"array"},{"type":"null"}],"title":"Receipt Boundary","description":"Detected receipt quad [[x,y], ...] (tl,tr,br,bl) in the ORIGINAL uploaded image's pixel coordinates. None if no boundary was found."},"analyzed_width":{"type":"integer","title":"Analyzed Width","description":"Width of the image actually fed to OCR (post-crop)"},"analyzed_height":{"type":"integer","title":"Analyzed Height","description":"Height of the image actually fed to OCR (post-crop)"},"is_receipt":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Receipt","description":"Receipt authenticity gate verdict. None if the check was disabled."},"receipt_confidence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Receipt Confidence","description":"P(receipt) from the ViT classifier. None if the check was disabled."}},"type":"object","required":["source","text_count","avg_confidence","min_confidence","max_confidence","full_text","results","latency_ms","backend","model","receipt_detected","analyzed_width","analyzed_height"],"title":"OcrReport"},"OcrTextResult":{"properties":{"text":{"type":"string","title":"Text"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence"},"detection_poly":{"anyOf":[{"items":{"items":{"type":"number"},"type":"array"},"type":"array"},{"type":"null"}],"title":"Detection Poly","description":"Detected text quad polygon as [[x, y], ...] in pixel coordinates"},"bbox":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"Bbox","description":"Axis-aligned bounding box [x_min, y_min, x_max, y_max]"}},"type":"object","required":["text","confidence"],"title":"OcrTextResult"}}}}