{"openapi":"3.1.0","info":{"title":"Jmod Moderation API","description":"","license":{"name":""},"version":"0.2.0"},"paths":{"/healthz":{"get":{"tags":[],"operationId":"health","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/readyz":{"get":{"tags":[],"summary":"Verifies authentication, usage, and policy storage in customer mode, but never calls OpenAI.","operationId":"ready","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"503":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}}}},"/v1/moderations":{"post":{"tags":[],"summary":"Classify one text, one image, or an image with a caption.\nReturns category confidence ratings with no decision by default. Optional customer\nrules return an advisory policy evaluation. Content is retained only when review is supplied.","operationId":"moderate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModerationRequest"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModerationResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"410":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"413":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"415":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"502":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"503":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"504":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"security":[{"bearerAuth":[]}]}},"/v1/reviews/{id}":{"get":{"tags":["reviews"],"summary":"Poll a retained review's human decision using any active key in its workspace.","operationId":"get_review","parameters":[{"name":"id","in":"path","description":"Review receipt ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewResult"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"410":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}},"503":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorBody"}}}}},"security":[{"bearerAuth":[]}]}}},"components":{"schemas":{"ApiErrorBody":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"CategoryRule":{"type":"object","required":["category"],"properties":{"block_at":{"type":["number","null"],"format":"double","description":"Inclusive block cutoff on the 1–10 confidence scale. Takes precedence over review."},"category":{"type":"string"},"review_at":{"type":["number","null"],"format":"double","description":"Inclusive review cutoff on the 1–10 confidence scale."}},"additionalProperties":false},"Decision":{"type":"string","enum":["allow","block","review"]},"HealthResponse":{"type":"object","required":["status","service"],"properties":{"service":{"type":"string"},"status":{"type":"string"}}},"ModerationPolicy":{"type":"object","required":["rules"],"properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/CategoryRule"},"description":"One to thirteen distinct category rules, evaluated using confidence ratings."}},"additionalProperties":false},"ModerationRequest":{"type":"object","properties":{"image_url":{"type":["string","null"],"description":"HTTPS image URL accessible to the provider, including a short-lived signed URL.\nAt most 8,192 bytes. Base64 uploads are not supported in this first version."},"policy":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ModerationPolicy","description":"Optional customer rules. Omit to receive scores without a Jmod decision."}]},"reference_id":{"type":["string","null"],"description":"Customer upload identifier for correlating results. Does not persist a review item."},"review":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ReviewOptions","description":"Opt in to retaining this successful assessment for human review. Omit for no review storage."}]},"saved_policy":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SavedPolicyReference","description":"Optional workspace-owned, immutable published version. Customer-key mode only.\nMutually exclusive with policy. Omit both for score-only requests."}]},"text":{"type":["string","null"],"description":"Text or caption to classify. At most 16,000 UTF-8 bytes."}},"additionalProperties":false},"ModerationResponse":{"type":"object","required":["id","model","scoring_version","confidence_ratings","flagged","categories","category_scores","category_applied_input_types","unsupported_image_categories","processing_ms"],"properties":{"categories":{"type":"object","additionalProperties":{"type":"boolean"},"propertyNames":{"type":"string"}},"category_applied_input_types":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"propertyNames":{"type":"string"}},"category_scores":{"type":"object","additionalProperties":{"type":"number","format":"double"},"propertyNames":{"type":"string"}},"confidence_ratings":{"type":"object","description":"Per-category confidence mapped to 1–10: round(100 * (1 + 9 * score)) / 100.\nNot severity, a probability, or a rating of factual truth. Null means unassessed.\nWith image + text input, ratings describe the combined submission.","additionalProperties":{"type":["number","null"],"format":"double"},"propertyNames":{"type":"string"}},"flagged":{"type":"boolean","description":"Raw provider advisory signal. Does not override the customer's rules."},"id":{"type":"string"},"model":{"type":"string"},"policy_evaluation":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PolicyEvaluation","description":"Null unless the customer supplied a policy. No automatic provider-flag override."}]},"processing_ms":{"type":"integer","format":"int64","description":"Original scoring-handler time, including the provider request.\nExcludes retention/usage commits, upload time and network transit.\nIdempotent review replays preserve this original measurement.","minimum":0},"reference_id":{"type":["string","null"]},"review":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ReviewReceipt","description":"Durable review receipt. Null on score-only requests."}]},"scoring_version":{"type":"string"},"unsupported_image_categories":{"type":"array","items":{"type":"string"},"description":"These categories are not checked on the image, even if a caption is supplied."}}},"PolicyEvaluation":{"type":"object","required":["decision","policy_version","policy","matches","unassessed_categories"],"properties":{"decision":{"$ref":"#/components/schemas/Decision","description":"Advisory outcome for the supplied rules only; the customer enforces publication."},"matches":{"type":"array","items":{"$ref":"#/components/schemas/PolicyMatch"}},"policy":{"$ref":"#/components/schemas/ModerationPolicy"},"policy_version":{"type":"string"},"saved_policy":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/SavedPolicyReference","description":"The immutable saved version used, when requested. policy_version identifies\nthe evaluator algorithm; this field identifies the customer's configuration."}]},"unassessed_categories":{"type":"array","items":{"type":"string"},"description":"Explicit rules that cannot cover every supplied input type. Require review\nunless another rule already blocks. Unsupported categories never imply allow."}}},"PolicyMatch":{"type":"object","required":["category","decision","confidence_rating","threshold"],"properties":{"category":{"type":"string"},"confidence_rating":{"type":"number","format":"double"},"decision":{"$ref":"#/components/schemas/Decision"},"threshold":{"type":"number","format":"double"}}},"ReviewEvent":{"type":"object","required":["id","revision","status","actor_id","note","created_at"],"properties":{"actor_id":{"type":"string"},"created_at":{"type":"string"},"id":{"type":"string"},"note":{"type":"string"},"revision":{"type":"integer","format":"int32"},"status":{"type":"string"}}},"ReviewOptions":{"type":"object","required":["idempotency_key"],"properties":{"idempotency_key":{"type":"string","description":"Unique UUID per submission. Reuse only for retries of the identical request."},"retention_days":{"type":["integer","null"],"format":"int32","description":"1–30 days, default 7. Stores text, the image URL and assessment, not image bytes.","minimum":0}},"additionalProperties":false},"ReviewReceipt":{"type":"object","required":["id","expires_at"],"properties":{"expires_at":{"type":"string","description":"UTC expiration. Image URLs can expire sooner; no image copy is made."},"id":{"type":"string"}}},"ReviewResult":{"type":"object","required":["id","status","revision","expires_at","assessment","events"],"properties":{"assessment":{"$ref":"#/components/schemas/ModerationResponse"},"events":{"type":"array","items":{"$ref":"#/components/schemas/ReviewEvent"}},"expires_at":{"type":"string"},"id":{"type":"string"},"reference_id":{"type":["string","null"]},"revision":{"type":"integer","format":"int32"},"status":{"type":"string"}}},"SavedPolicyReference":{"type":"object","required":["id","version"],"properties":{"id":{"type":"string","description":"Policy UUID belonging to the authenticated workspace."},"version":{"type":"integer","format":"int32","description":"Explicit published version, from 1 through 2,147,483,647.","minimum":0}},"additionalProperties":false}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}}}