{"openapi": "3.1.0", "info": {"title": "P-editor API", "version": "1.0.0", "description": "Async document editing, peer review, similarity, plagiarism, and text utility endpoints."}, "servers": [{"url": "https://api.p-editor.ir/v1"}], "components": {"securitySchemes": {"ApiKeyAuth": {"type": "http", "scheme": "bearer"}}, "schemas": {"ApiSuccess": {"type": "object", "properties": {"success": {"type": "boolean"}, "data": {"type": "object"}, "request_id": {"type": "string"}}}, "ApiError": {"type": "object", "properties": {"success": {"type": "boolean"}, "error": {"type": "object", "properties": {"code": {"type": "string"}, "message": {"type": "string"}, "details": {}}}, "request_id": {"type": "string"}}}}}, "security": [{"ApiKeyAuth": []}], "paths": {"/services/": {"get": {"summary": "List available services for the authenticated user.", "responses": {"200": {"description": "Successful response", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/ApiSuccess"}, {"type": "object", "properties": {"data": {"type": "array", "items": {"type": "object"}}}}]}}}}}}}, "/requests/": {"get": {"summary": "List authenticated user's requests.", "parameters": [{"name": "service", "in": "query", "required": false, "schema": {"type": "string"}, "description": "Filter by service code."}, {"name": "status", "in": "query", "required": false, "schema": {"type": "string", "enum": ["inprogress", "processed", "failed"]}, "description": "Filter by request status."}, {"name": "page_size", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 20}, "description": "Maximum number of requests to return."}], "responses": {"200": {"description": "Successful response", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/ApiSuccess"}, {"type": "object", "properties": {"data": {"type": "object"}}}]}}}}}}}, "/requests/{tracking_id}/": {"get": {"summary": "Get request status and result links.", "parameters": [{"name": "tracking_id", "in": "path", "required": true, "description": "Request tracking id returned when the async request was created.", "schema": {"type": "string"}}], "responses": {"200": {"description": "Successful response", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/ApiSuccess"}, {"type": "object", "properties": {"data": {"type": "object"}}}]}}}}}}}, "/requests/{tracking_id}/download/": {"get": {"summary": "Download the processed result file.", "parameters": [{"name": "tracking_id", "in": "path", "required": true, "description": "Request tracking id returned when the async request was created.", "schema": {"type": "string"}}], "responses": {"200": {"description": "Processed result file.", "content": {"application/octet-stream": {"schema": {"type": "string", "format": "binary"}}}}}}}, "/text/language-edit/": {"post": {"summary": "Edit short text synchronously.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["text"], "properties": {"text": {"type": "string", "maxLength": 8000, "description": "Plain text to edit.", "example": "This paper present a new method."}, "return_diff": {"type": "boolean", "default": true, "description": "Return an HTML diff between original and edited text."}}}}}}, "responses": {"200": {"description": "Successful response", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/ApiSuccess"}, {"type": "object", "properties": {"data": {"type": "object", "properties": {"service": {"type": "string", "example": "text-language-edit"}, "words": {"type": "integer"}, "charged_credit": {"type": "string"}, "remaining_credit": {"type": "string"}, "original": {"type": "string"}, "edited": {"type": "string"}, "diff_html": {"type": "string"}}}}}]}}}}}}}, "/text/paraphrase/": {"post": {"summary": "Paraphrase text synchronously.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["text"], "properties": {"text": {"type": "string", "maxLength": 20000, "description": "Plain text to paraphrase.", "example": "This paragraph should be rewritten in a clearer academic style."}}}}}}, "responses": {"200": {"description": "Successful response", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/ApiSuccess"}, {"type": "object", "properties": {"data": {"type": "object", "properties": {"service": {"type": "string", "example": "text-paraphrase"}, "original": {"type": "string"}, "paraphrased": {"type": "string"}, "diff_html": {"type": "string"}}}}}]}}}}}}}, "/services/language-editing/estimate/": {"post": {"summary": "Estimate Language Editing cost and limits.", "description": "Submit a manuscript for academic language editing.", "tags": ["Language Editing"], "operationId": "estimate_language_editing", "x-service-code": "language-editing", "x-request-supported": true, "requestBody": {"content": {"multipart/form-data": {"schema": {"type": "object", "required": ["title", "abstract", "file"], "properties": {"file": {"type": "string", "format": "binary"}, "title": {"type": "string", "maxLength": 255}, "abstract": {"type": "string"}}}}, "application/json": {"schema": {"type": "object", "required": ["title", "abstract", "file"], "properties": {"file": {"type": "string", "format": "binary"}, "title": {"type": "string", "maxLength": 255}, "abstract": {"type": "string"}}}}}}, "responses": {"200": {"description": "Estimate response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiSuccess"}}}}}}}, "/services/language-editing/requests/": {"post": {"summary": "Create a Language Editing request.", "description": "Submit a manuscript for academic language editing.", "tags": ["Language Editing"], "operationId": "create_language_editing_request", "x-service-code": "language-editing", "x-request-supported": true, "x-file-requirements": {"field": "file", "formats": ["doc", "docx"], "max_files": 1, "min_files": 1}, "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"type": "object", "required": ["title", "abstract", "file"], "properties": {"file": {"type": "string", "format": "binary"}, "title": {"type": "string", "maxLength": 255}, "abstract": {"type": "string"}}}}}}, "responses": {"202": {"description": "Async request accepted", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/ApiSuccess"}, {"type": "object", "properties": {"data": {"type": "object", "properties": {"id": {"type": "integer"}, "links": {"type": "object", "properties": {"status": {"type": "string", "format": "uri"}, "download": {"type": "string", "format": "uri"}}}, "title": {"type": "string"}, "status": {"enum": ["processing", "processed", "failed"], "type": "string"}, "service": {"type": "string"}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}, "tracking_id": {"type": "string"}, "internal_status": {"type": "string"}, "result_available": {"type": "boolean"}}}}}]}}}}}}}, "/services/plagiarism-check/estimate/": {"post": {"summary": "Estimate Plagiarism Check cost and limits.", "description": "Upload one document and receive an async plagiarism scan report.", "tags": ["Plagiarism Check"], "operationId": "estimate_plagiarism_check", "x-service-code": "plagiarism-check", "x-request-supported": true, "requestBody": {"content": {"multipart/form-data": {"schema": {"type": "object", "required": ["file"], "properties": {"file": {"type": "string", "format": "binary"}, "mode": {"type": "string", "default": "full"}}}}, "application/json": {"schema": {"type": "object", "required": ["file"], "properties": {"file": {"type": "string", "format": "binary"}, "mode": {"type": "string", "default": "full"}}}}}}, "responses": {"200": {"description": "Estimate response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiSuccess"}}}}}}}, "/services/plagiarism-check/requests/": {"post": {"summary": "Create a Plagiarism Check request.", "description": "Upload one document and receive an async plagiarism scan report.", "tags": ["Plagiarism Check"], "operationId": "create_plagiarism_check_request", "x-service-code": "plagiarism-check", "x-request-supported": true, "x-file-requirements": {"field": "file", "aliases": ["source_file", "source_pdf"], "formats": ["pdf", "docx", "txt"], "max_files": 1, "min_files": 1}, "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"type": "object", "required": ["file"], "properties": {"file": {"type": "string", "format": "binary"}, "mode": {"type": "string", "default": "full"}}}}}}, "responses": {"202": {"description": "Async request accepted", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/ApiSuccess"}, {"type": "object", "properties": {"data": {"type": "object", "properties": {"id": {"type": "integer"}, "links": {"type": "object", "properties": {"status": {"type": "string", "format": "uri"}, "download": {"type": "string", "format": "uri"}}}, "title": {"type": "string"}, "status": {"enum": ["processing", "processed", "failed"], "type": "string"}, "service": {"type": "string"}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}, "tracking_id": {"type": "string"}, "internal_status": {"type": "string"}, "result_available": {"type": "boolean"}}}}}]}}}}}}}, "/services/proofreading/estimate/": {"post": {"summary": "Estimate Proofreding cost and limits.", "description": "Submit a manuscript for scientific proofreading with tracked result files.", "tags": ["Proofreding"], "operationId": "estimate_proofreading", "x-service-code": "proofreading", "x-request-supported": true, "requestBody": {"content": {"multipart/form-data": {"schema": {"type": "object", "required": ["title", "abstract", "file"], "properties": {"file": {"type": "string", "format": "binary"}, "title": {"type": "string", "maxLength": 255}, "abstract": {"type": "string"}}}}, "application/json": {"schema": {"type": "object", "required": ["title", "abstract", "file"], "properties": {"file": {"type": "string", "format": "binary"}, "title": {"type": "string", "maxLength": 255}, "abstract": {"type": "string"}}}}}}, "responses": {"200": {"description": "Estimate response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiSuccess"}}}}}}}, "/services/proofreading/requests/": {"post": {"summary": "Create a Proofreding request.", "description": "Submit a manuscript for scientific proofreading with tracked result files.", "tags": ["Proofreding"], "operationId": "create_proofreading_request", "x-service-code": "proofreading", "x-request-supported": true, "x-file-requirements": {"field": "file", "formats": ["doc", "docx", "pdf", "tex"], "max_files": 1, "min_files": 1}, "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"type": "object", "required": ["title", "abstract", "file"], "properties": {"file": {"type": "string", "format": "binary"}, "title": {"type": "string", "maxLength": 255}, "abstract": {"type": "string"}}}}}}, "responses": {"202": {"description": "Async request accepted", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/ApiSuccess"}, {"type": "object", "properties": {"data": {"type": "object", "properties": {"id": {"type": "integer"}, "links": {"type": "object", "properties": {"status": {"type": "string", "format": "uri"}, "download": {"type": "string", "format": "uri"}}}, "title": {"type": "string"}, "status": {"enum": ["processing", "processed", "failed"], "type": "string"}, "service": {"type": "string"}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}, "tracking_id": {"type": "string"}, "internal_status": {"type": "string"}, "result_available": {"type": "boolean"}}}}}]}}}}}}}, "/services/article-similarity/estimate/": {"post": {"summary": "Estimate Article Similarity cost and limits.", "description": "Upload two or more documents and receive an async similarity report.", "tags": ["Article Similarity"], "operationId": "estimate_article_similarity", "x-service-code": "article-similarity", "x-request-supported": true, "requestBody": {"content": {"multipart/form-data": {"schema": {"type": "object", "required": ["files"], "properties": {"files": {"type": "array", "items": {"type": "string", "format": "binary"}, "minItems": 2}, "compare_mode": {"type": "string", "default": "multi_documents"}}}}, "application/json": {"schema": {"type": "object", "required": ["files"], "properties": {"files": {"type": "array", "items": {"type": "string", "format": "binary"}, "minItems": 2}, "compare_mode": {"type": "string", "default": "multi_documents"}}}}}}, "responses": {"200": {"description": "Estimate response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiSuccess"}}}}}}}, "/services/article-similarity/requests/": {"post": {"summary": "Create a Article Similarity request.", "description": "Upload two or more documents and receive an async similarity report.", "tags": ["Article Similarity"], "operationId": "create_article_similarity_request", "x-service-code": "article-similarity", "x-request-supported": true, "x-file-requirements": {"field": "files", "aliases": ["multi_files"], "formats": ["pdf", "docx", "txt"], "min_files": 2}, "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"type": "object", "required": ["files"], "properties": {"files": {"type": "array", "items": {"type": "string", "format": "binary"}, "minItems": 2}, "compare_mode": {"type": "string", "default": "multi_documents"}}}}}}, "responses": {"202": {"description": "Async request accepted", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/ApiSuccess"}, {"type": "object", "properties": {"data": {"type": "object", "properties": {"id": {"type": "integer"}, "links": {"type": "object", "properties": {"status": {"type": "string", "format": "uri"}, "download": {"type": "string", "format": "uri"}}}, "title": {"type": "string"}, "status": {"enum": ["processing", "processed", "failed"], "type": "string"}, "service": {"type": "string"}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}, "tracking_id": {"type": "string"}, "internal_status": {"type": "string"}, "result_available": {"type": "boolean"}}}}}]}}}}}}}, "/services/article-review/estimate/": {"post": {"summary": "Estimate Article Review cost and limits.", "description": "Submit a manuscript for structured scientific peer review.", "tags": ["Article Review"], "operationId": "estimate_article_review", "x-service-code": "article-review", "x-request-supported": true, "requestBody": {"content": {"multipart/form-data": {"schema": {"type": "object", "required": ["title", "abstract", "file"], "properties": {"file": {"type": "string", "format": "binary"}, "title": {"type": "string", "maxLength": 255}, "abstract": {"type": "string"}}}}, "application/json": {"schema": {"type": "object", "required": ["title", "abstract", "file"], "properties": {"file": {"type": "string", "format": "binary"}, "title": {"type": "string", "maxLength": 255}, "abstract": {"type": "string"}}}}}}, "responses": {"200": {"description": "Estimate response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiSuccess"}}}}}}}, "/services/article-review/requests/": {"post": {"summary": "Create a Article Review request.", "description": "Submit a manuscript for structured scientific peer review.", "tags": ["Article Review"], "operationId": "create_article_review_request", "x-service-code": "article-review", "x-request-supported": true, "x-file-requirements": {"field": "file", "formats": ["doc", "docx", "pdf", "tex"], "max_files": 1, "min_files": 1}, "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"type": "object", "required": ["title", "abstract", "file"], "properties": {"file": {"type": "string", "format": "binary"}, "title": {"type": "string", "maxLength": 255}, "abstract": {"type": "string"}}}}}}, "responses": {"202": {"description": "Async request accepted", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/ApiSuccess"}, {"type": "object", "properties": {"data": {"type": "object", "properties": {"id": {"type": "integer"}, "links": {"type": "object", "properties": {"status": {"type": "string", "format": "uri"}, "download": {"type": "string", "format": "uri"}}}, "title": {"type": "string"}, "status": {"enum": ["processing", "processed", "failed"], "type": "string"}, "service": {"type": "string"}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}, "tracking_id": {"type": "string"}, "internal_status": {"type": "string"}, "result_available": {"type": "boolean"}}}}}]}}}}}}}, "/services/humanizer/estimate/": {"post": {"summary": "Estimate Humanizer Audit cost and limits.", "description": "Submit a manuscript for humanizer audit and receive an async report with AI-detection signals, section-level findings.", "tags": ["Humanizer Audit"], "operationId": "estimate_humanizer", "x-service-code": "humanizer", "x-request-supported": true, "requestBody": {"content": {"multipart/form-data": {"schema": {"type": "object", "required": ["title", "abstract", "file"], "properties": {"file": {"type": "string", "format": "binary"}, "title": {"type": "string", "maxLength": 255}, "abstract": {"type": "string"}}}}, "application/json": {"schema": {"type": "object", "required": ["title", "abstract", "file"], "properties": {"file": {"type": "string", "format": "binary"}, "title": {"type": "string", "maxLength": 255}, "abstract": {"type": "string"}}}}}}, "responses": {"200": {"description": "Estimate response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiSuccess"}}}}}}}, "/services/humanizer/requests/": {"post": {"summary": "Create a Humanizer Audit request.", "description": "Submit a manuscript for humanizer audit and receive an async report with AI-detection signals, section-level findings.", "tags": ["Humanizer Audit"], "operationId": "create_humanizer_request", "x-service-code": "humanizer", "x-request-supported": true, "x-file-requirements": {"field": "file", "formats": ["doc", "docx", "pdf", "tex"], "max_files": 1, "min_files": 1}, "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"type": "object", "required": ["title", "abstract", "file"], "properties": {"file": {"type": "string", "format": "binary"}, "title": {"type": "string", "maxLength": 255}, "abstract": {"type": "string"}}}}}}, "responses": {"202": {"description": "Async request accepted", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/ApiSuccess"}, {"type": "object", "properties": {"data": {"type": "object", "properties": {"id": {"type": "integer"}, "links": {"type": "object", "properties": {"status": {"type": "string", "format": "uri"}, "download": {"type": "string", "format": "uri"}}}, "title": {"type": "string"}, "status": {"enum": ["processing", "processed", "failed"], "type": "string"}, "service": {"type": "string"}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}, "tracking_id": {"type": "string"}, "internal_status": {"type": "string"}, "result_available": {"type": "boolean"}}}}}]}}}}}}}}}