Skip to content

Classify Text or Images

POST/v1/moderations

Overview

Classify text through an exact OpenAI or Mistral moderation model.

Routing and provider details

OpenAI also accepts one inline image, optionally accompanied by one text part. Requires an API key with the opt-in moderation.write scope and an enabled direct-core Router deployment. Also accepts /api/v1/moderations. Integration preview until staging acceptance and release.

These reviewed endpoints are free; no wallet debit or token usage is fabricated. Workspace limits are 60 requests per minute, 1000 per day, and four concurrent calls. Privacy settings apply before dispatch. Inputs and classifications are not persisted; request metadata appears in Logs.

Text is limited to 16384 UTF-8 bytes. Images must be inline base64 PNG, JPEG, or WebP, at most 1 MiB and 2048 by 2048 pixels. Remote URLs, animations, batches, streaming, automatic retry, and Idempotency-Key are unsupported. The JSON body limit is 1500000 bytes. OpenAI returns flagged, nullable illicit categories, confidence scores and category_applied_input_types. Mistral returns its own category names and scores, without a synthesized flagged field. A flagged classification is a successful response; provider errors never mean content is safe.

Authorization

Authorizationstring · headerRequired

AudioLab API key sent as Bearer <token>. Authentication guide

Request Body

application/json
providerobject

Provider preferences for a single-endpoint product.

Show nested fields
data_regionstring | string[]

Route only to endpoints documented as processing in this region: us, eu (which includes EU member states), or a country code such as nl, sg, in or cn. A list matches any of its regions. Endpoints whose region is global or unknown never match; global on its own means no requirement. The request's region narrows the workspace's Data Region and a named router's region policy, and never widens them. Fallbacks keep to it. When no endpoint qualifies, the request is refused with 400 data_region_unavailable, param provider.data_region.

Show nested fields
Option 1: string

string

Option 2: string[]

See the OpenAPI schema for this nested object.

modelstringRequired

Values: "openai/omni-moderation-2024-09-26""mistral/mistral-moderation-2603"

inputstring | object | object[]Required
Show nested fields
Option 1: string

string

Option 2: object | object[]
Option 1: object

See the OpenAPI schema for this nested object.

Option 2: object

See the OpenAPI schema for this nested object.

Responses

200Native provider classification. Costs are zero.
application/json
idstringRequired
modelstringRequired
resultsobject[]Required
Show nested fields
flaggedboolean

OpenAI only.

categoriesobjectRequired
category_scoresobjectRequired
category_applied_input_typesobject
401Invalid API key.
403Scope, workspace, key lifetime or privacy restriction.
413Request body exceeds its limit.
422Invalid request or provider-rejected input.
429Workspace or provider rate limit.
502Invalid or failed provider response.
503Model is not enabled or journal is unavailable.
504Provider exceeded the complete response deadline.