Skip to content

A focused API.

One scoring endpoint. Structured results your backend can act on.

POST/v1/moderations

Authenticate with Authorization: Bearer $JMOD_API_KEY and send Content-Type: application/json. Supply at least one nonempty text or image input. Unknown request fields are rejected.

Request fields

FieldTypeMeaning
reviewobject · optionalOpt in to retained human review. Requires a unique idempotency_key UUID; retention_days is 1–30 (default 7). Customer-key mode only. Stores text, URL and scores, not image bytes.
textstring · optionalText or caption, up to 16,000 UTF-8 bytes.
image_urlstring · optionalPublicly accessible HTTPS URL, up to 8,192 bytes. No base64.
reference_idstring · optionalYour correlation ID. Does not create a stored review record.
policyobject · optionalOne to thirteen distinct category rules. Omit both policy fields for scores only.
saved_policyobject · optionalWorkspace policy reference with UUID id and required published version. Mutually exclusive with policy; customer-key mode only.

Response fields

The names below come from the generated Rust schema. See the complete OpenAPI document for exact types and requirements.

categories
Original provider category flags.
category_applied_input_types
Input types the provider assessed for each category.
category_scores
Original provider category scores. Preserve them alongside review decisions.
confidence_ratings
Per-category confidence mapped to 1–10: round(100 * (1 + 9 * score)) / 100. Not severity, a probability, or a rating of factual truth. Null means unassessed. With image + text input, ratings describe the combined submission.
flagged
Raw provider advisory signal. Does not override the customer's rules.
id
Identifier for this result.
model
The model used to generate the result.
policy_evaluation
Your submitted correlation identifier, when supplied.
processing_ms
Original scoring-handler time, including the provider request. Excludes retention/usage commits, upload time and network transit. Idempotent review replays preserve this original measurement.
reference_id
Your submitted correlation identifier, when supplied.
review
Your submitted correlation identifier, when supplied.
scoring_version
Version of the confidence mapping.
unsupported_image_categories
These categories are not checked on the image, even if a caption is supplied.

Errors remain unresolved

Example error response
{"code":"invalid_request","message":"Provide text or an image URL."}
StatusHandling
400 / 422Correct invalid request fields, input, or policy rules.
401Check that the bearer key is valid, has not been revoked, and matches the deployment’s authentication mode.
413Reduce the request body size.
404The saved policy version or review was not found in this workspace. Keep the upload pending.
409A retention key belongs to different input, or the workspace review limit was reached.
410The retained submission expired or was deleted. Do not reuse its retry key.
429Back off; capacity or rate limits were reached.
502 / 503 / 504Provider, authentication/usage/policy/review storage, availability, or timeout failure. Keep the upload unresolved and retry with bounded backoff.

In customer mode, all keys in a workspace share a fixed-minute request limit across Rust replicas (600 requests per minute by default, set by the operator). Authenticated attempts count, including invalid requests and provider failures. A 429 response includes Retry-After. This admission limit is separate from billing or successful-scan usage.

Usage reporting

Customer-mode requests record daily counts and timings by workspace and API key. See them in your dashboard’s Usage & billing page. Usage records contain no content, image URLs, scores, or submission references. Optional review retention stores those separately when explicitly requested. Invalid or revoked keys and authentication failures are excluded; successful scans, invalid inputs, limits, and provider/service errors stay separate.

Rust waits for usage recording before returning a result. An unavailable write returns 503 usage_unavailable with no decision. Counts describe recorded attempts, including retries. A lost acknowledgment may leave a count even when the client receives an error. These totals are not an invoice ledger; billing deduplication is not enabled. Review retry keys deduplicate retained items only.

Retained review workflow

Add review to retain a successful assessment. The response includes a durable receipt with id and expires_at. Any opted-in submission enters pending human review, independent of policy advice. Omit this field for no review storage.

Optional review field
"review": {
  "idempotency_key": "5a297aef-c8f8-46b6-9f18-2d743a117612",
  "retention_days": 7
}

Use the same UUID only to retry identical input. A retry returns the original retained result; changed input returns 409. Concurrent first attempts can call the provider more than once, but retain one item. A 503 may follow a committed write, so retry with the same UUID.

GET/v1/reviews/{id}

Poll with an active workspace bearer key for status (pending, approved, or rejected), revision, the original assessment, and decision events. Your backend decides when to publish. Polling counts toward the shared request rate limit, but not scan usage. Signed decision notifications are available through workspace Webhooks settings.

Owners/admins use the Review inbox to approve, reject, reopen, or delete items. Members can inspect them. Notes, actors, and timestamps stay separate from original scores. Stale decisions require reloading the latest record.

Jmod retains text and image URLs, not image copies. Use an immutable URL available throughout review. Images load only on demand and can expire independently of their scores. Expiry blocks reads immediately; a background task scrubs expired content in bounded batches. Owners/admins can delete earlier. Minimal retry tombstones expire 30 days after the original retention expiry. Maximum 10,000 active items per workspace and 100 decisions per item.

Timing & health

Server-Timing reports app, provider, total, and usage in milliseconds. The response’s processing_ms includes the provider request inside the handler, but excludes authentication, rate-limit checks, body receipt, the final usage write, and client network transit. Retained assessments also exclude the review commit, and replays preserve their original processing time. Use Server-Timing for the full server path; its app includes customer authentication, admission control, and usage recording. The usage duration is a portion of app. Dashboard processing averages exclude that final write; model-wait averages cover only requests that reached the provider, including failures.

GET /healthz checks service liveness. GET /readyz checks configuration, authentication, usage, policy, and review storage in customer mode. It does not validate credentials with the upstream provider.