{"openapi":"3.0.3","info":{"title":"Paste-Content-Filter API","version":"1.3.0","description":"Dịch vụ kiểm duyệt nội dung: lọc từ khóa Banned/Censored, phát hiện link lách luật đa tầng (cơ bản, bare domain, mã hóa, làm rối, khoảng cách, xuống dòng, emoji, kết hợp), quản lý API key & giới hạn theo lượt/site."},"servers":[{"url":"https://paste-content-filter.aioapi.top"}],"components":{"securitySchemes":{"ApiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API Key tạo từ trang quản trị /admin (BẮT BUỘC cho mọi yêu cầu API)."},"BearerAuth":{"type":"http","scheme":"bearer","description":"Có thể truyền API Key dưới dạng Authorization: Bearer pcf_live_..."}},"schemas":{"ModerateOptions":{"type":"object","properties":{"checkKeywords":{"type":"boolean"},"checkLinks":{"type":"boolean"},"linkAction":{"type":"string","enum":["allow","flag","censor","block"]},"emailAction":{"type":"string","enum":["ignore","flag","censor","block"]},"extraAllowedDomains":{"type":"array","items":{"type":"string"}}}},"ModerateRequest":{"type":"object","required":["content"],"properties":{"content":{"type":"string","example":"Nội dung paste cần kiểm duyệt..."},"encoding":{"type":"string","enum":["plain","base64"],"default":"plain","description":"Chọn base64 nếu content đã được mã hóa Base64 UTF-8 trước khi gửi (tránh lỗi WAF/XSS/SQLi/UTF-8)."},"responseEncoding":{"type":"string","enum":["plain","base64"],"description":"Định dạng trả về cho sanitizedContent & rawMatch. Mặc định giống encoding đầu vào."},"options":{"$ref":"#/components/schemas/ModerateOptions"}}},"ModerateBatchRequest":{"type":"object","required":["items"],"properties":{"items":{"type":"array","minItems":1,"items":{"type":"string"},"example":["Nội dung sạch","đồ ngu","e x 🔥 a m p l e [ . ] c o m"]},"encoding":{"type":"string","enum":["plain","base64"],"default":"plain"},"responseEncoding":{"type":"string","enum":["plain","base64"]},"options":{"$ref":"#/components/schemas/ModerateOptions"}}},"ModerationResult":{"type":"object","properties":{"action":{"type":"string","enum":["allow","flag","censor","block"]},"allowed":{"type":"boolean","description":"true với allow/flag/censor; false khi bị block"},"blocked":{"type":"boolean"},"isClean":{"type":"boolean"},"sanitizedContent":{"type":"string","description":"Nội dung sau khi đã che các từ khóa Censored (hoặc Link nếu action=censor)"},"summary":{"type":"object","properties":{"totalMatches":{"type":"integer"},"bannedCount":{"type":"integer"},"censoredCount":{"type":"integer"},"linkCount":{"type":"integer"},"emailCount":{"type":"integer"}}},"matches":{"type":"array","items":{"type":"object"}},"meta":{"type":"object","properties":{"processingTimeMs":{"type":"number"},"configVersion":{"type":"string"},"contentLength":{"type":"integer"}}}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/api/v1/moderate":{"post":{"tags":["Moderation"],"summary":"Kiểm duyệt 1 nội dung văn bản (bắt buộc API Key)","security":[{"ApiKeyHeader":[]},{"BearerAuth":[]}],"parameters":[{"name":"X-Site-Domain","in":"header","required":false,"schema":{"type":"string"},"description":"Tên miền site gọi API (dùng cho backend-to-backend khi không có Origin/Referer để kiểm tra giới hạn theo site và thống kê)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModerateRequest"}}}},"responses":{"200":{"description":"Kết quả kiểm duyệt chi tiết","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}},"X-Quota-Daily-Limit":{"schema":{"type":"integer"}},"X-Quota-Daily-Remaining":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModerationResult"}}}},"400":{"description":"Payload không hợp lệ"},"401":{"description":"Thiếu hoặc sai API Key"},"403":{"description":"API Key bị khóa/hết hạn hoặc Site không được phép"},"413":{"description":"Nội dung vượt quá maxContentLength"},"429":{"description":"Vượt quá giới hạn lượt/phút hoặc hạn mức ngày/tháng/tổng"}}}},"/api/v1/moderate/fields":{"post":{"tags":["Moderation"],"summary":"Kiểm duyệt nhiều trường (title, description, tags, content) trong 1 request + fail-fast","security":[{"ApiKeyHeader":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["fields"],"properties":{"encoding":{"type":"string","enum":["plain","base64"],"default":"plain","description":"Dùng base64 để mã hóa toàn bộ giá trị trường đầu vào & tự động mã hóa base64 chiều trả về."},"responseEncoding":{"type":"string","enum":["plain","base64"]},"fields":{"type":"object","additionalProperties":{"type":"string"},"example":{"title":"Tiêu đề","description":"Mô tả","tags":"php, laravel","content":"Nội dung paste..."}},"options":{"allOf":[{"$ref":"#/components/schemas/ModerateOptions"},{"type":"object","properties":{"stopOnBlock":{"type":"boolean","default":true,"description":"Dừng ngay khi gặp trường đầu tiên bị block (fail-fast)"}}}]}}}}}},"responses":{"200":{"description":"Kết quả kiểm duyệt tổng hợp & theo từng trường"},"401":{"description":"Thiếu hoặc sai API Key"},"403":{"description":"Site không được phép hoặc Key bị khóa"},"429":{"description":"Vượt quá giới hạn tốc độ / hạn mức lượt"}}}},"/api/v1/moderate/batch":{"post":{"tags":["Moderation"],"summary":"Kiểm duyệt hàng loạt nhiều nội dung trong 1 request (bắt buộc API Key)","security":[{"ApiKeyHeader":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModerateBatchRequest"}}}},"responses":{"200":{"description":"Danh sách kết quả kiểm duyệt theo thứ tự đầu vào"},"401":{"description":"Thiếu hoặc sai API Key"},"403":{"description":"Site không được phép hoặc Key bị khóa"},"429":{"description":"Vượt quá giới hạn tốc độ / hạn mức lượt"}}}},"/api/v1/health":{"get":{"tags":["System"],"summary":"Kiểm tra trạng thái hoạt động của dịch vụ","responses":{"200":{"description":"OK"}}}},"/api/v1/config/summary":{"get":{"tags":["System"],"summary":"Xem tóm tắt cấu hình kiểm duyệt hiện tại","responses":{"200":{"description":"OK"}}}}}}