{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://dev-ocr.withvus.com","description":"Generated server url"}],"tags":[{"name":"OCR Request","description":"OCR 작업 접수/조회 API"}],"paths":{"/api/v1/ocr":{"get":{"tags":["OCR Request"],"summary":"목록 조회","operationId":"list","parameters":[{"name":"requesterKeyEq","in":"query","required":false,"schema":{"type":"string"}},{"name":"docTypeEq","in":"query","required":false,"schema":{"type":"string"}},{"name":"statusEq","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","PROCESSING","DONE","FAILED","DEAD"]}},{"name":"reqIdEq","in":"query","required":false,"schema":{"type":"string"}},{"name":"id","in":"query","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"groupKey","in":"query","required":false,"schema":{"type":"string"}},{"name":"keyword","in":"query","required":false,"schema":{"type":"string"}},{"name":"fromCreatedAt","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"toCreatedAt","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":1}},{"name":"sort","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PageOcrRequestDto"}}}}}},"post":{"tags":["OCR Request"],"summary":"OCR 작업 접수","description":"multipart로 메타(JSON part 'meta')와 파일(part 'file')을 받는다. req_id 멱등 히트 시 201 대신 200으로 기존 건을 반환한다.","operationId":"accept","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/OcrRequestDto"},"file":{"type":"string","format":"binary"}},"required":["file","meta"]}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OcrRequestDto"}}}}}}},"/api/v1/ocr/{id}":{"get":{"tags":["OCR Request"],"summary":"단건 조회","description":"종결 상태면 최종 결과(result)를 함께 반환한다. 호출자 폴링용.","operationId":"get","parameters":[{"name":"id","in":"path","description":"ID","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OcrRequestDto"}}}}}}}},"components":{"schemas":{"OcrRequestDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"groupKey":{"type":"string"},"createdBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedBy":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"useYn":{"type":"string","enum":["Y","N"]},"delYn":{"type":"string","enum":["Y","N"]},"requesterKey":{"type":"string"},"docType":{"type":"string"},"requestParams":{"type":"string"},"reqId":{"type":"string"},"filePath":{"type":"string"},"fileName":{"type":"string"},"contentType":{"type":"string"},"fileSize":{"type":"integer","format":"int32"},"status":{"type":"string","enum":["PENDING","PROCESSING","DONE","FAILED","DEAD"]},"retryCount":{"type":"integer","format":"int32"},"maxRetry":{"type":"integer","format":"int32"},"nextRetryAt":{"type":"string","format":"date-time"},"callbackUrl":{"type":"string"},"callbackStatus":{"type":"string","enum":["PENDING","SENT","FAILED","SKIPPED"]},"callbackAt":{"type":"string","format":"date-time"},"filePurgedAt":{"type":"string","format":"date-time"},"result":{"$ref":"#/components/schemas/OcrResultDto"}},"required":["docType"]},"OcrResultDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"groupKey":{"type":"string"},"createdBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedBy":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"useYn":{"type":"string","enum":["Y","N"]},"delYn":{"type":"string","enum":["Y","N"]},"requestId":{"type":"integer","format":"int64"},"attempt":{"type":"integer","format":"int32"},"engine":{"type":"string"},"status":{"type":"string","enum":["SUCCESS","FAILED"]},"errorType":{"type":"string","enum":["TRANSIENT","PERMANENT","CONFIG"]},"responseCode":{"type":"string"},"errorMessage":{"type":"string"},"externalId":{"type":"string"},"model":{"type":"string"},"promptId":{"type":"string"},"promptVersion":{"type":"string"},"rawResponse":{"type":"string"},"inputTokens":{"type":"integer","format":"int32"},"outputTokens":{"type":"integer","format":"int32"},"elapsedMs":{"type":"integer","format":"int32"},"processedAt":{"type":"string","format":"date-time"}}},"PageOcrRequestDto":{"type":"object","properties":{"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"},"pageable":{"$ref":"#/components/schemas/PageableObject"},"size":{"type":"integer","format":"int32"},"content":{"type":"array","items":{"$ref":"#/components/schemas/OcrRequestDto"}},"number":{"type":"integer","format":"int32"},"sort":{"$ref":"#/components/schemas/SortObject"},"first":{"type":"boolean"},"last":{"type":"boolean"},"numberOfElements":{"type":"integer","format":"int32"},"empty":{"type":"boolean"}}},"PageableObject":{"type":"object","properties":{"paged":{"type":"boolean"},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"offset":{"type":"integer","format":"int64"},"sort":{"$ref":"#/components/schemas/SortObject"},"unpaged":{"type":"boolean"}}},"SortObject":{"type":"object","properties":{"sorted":{"type":"boolean"},"empty":{"type":"boolean"},"unsorted":{"type":"boolean"}}}}}}