curl --request POST \
--url https://api.apimart.ai/v1/moderations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "omni-moderation-latest",
"input": [
{
"type": "text",
"text": "Bitte prüfen, ob dieses Bild gegen Richtlinien verstößt"
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.apimart.ai/files/1779955589195-wh950j4imqd.jpeg"
}
}
],
"stream": false
}'
import requests
url = "https://api.apimart.ai/v1/moderations"
payload = {
"model": "omni-moderation-latest",
"input": [
{
"type": "text",
"text": "Bitte prüfen, ob dieses Bild gegen Richtlinien verstößt"
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.apimart.ai/files/1779955589195-wh950j4imqd.jpeg"
}
}
],
"stream": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/moderations";
const payload = {
model: "omni-moderation-latest",
input: [
{
type: "text",
text: "Bitte prüfen, ob dieses Bild gegen Richtlinien verstößt",
},
{
type: "image_url",
image_url: {
url: "https://cdn.apimart.ai/files/1779955589195-wh950j4imqd.jpeg",
},
},
],
stream: false,
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
omni-moderation-latest
omni-moderation-latest Inhaltsmoderation
- Unterstützt Text-, Bild- sowie gemischte Text+Bild-Inhaltsmoderation
- Kompatibel mit einzelnen Texten, Text-Arrays und Inhaltsblock-Arrays als Eingabe
- Bilder unterstützen öffentliche URLs und base64 Data URIs
POST
/
v1
/
moderations
curl --request POST \
--url https://api.apimart.ai/v1/moderations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "omni-moderation-latest",
"input": [
{
"type": "text",
"text": "Bitte prüfen, ob dieses Bild gegen Richtlinien verstößt"
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.apimart.ai/files/1779955589195-wh950j4imqd.jpeg"
}
}
],
"stream": false
}'
import requests
url = "https://api.apimart.ai/v1/moderations"
payload = {
"model": "omni-moderation-latest",
"input": [
{
"type": "text",
"text": "Bitte prüfen, ob dieses Bild gegen Richtlinien verstößt"
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.apimart.ai/files/1779955589195-wh950j4imqd.jpeg"
}
}
],
"stream": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/moderations";
const payload = {
model: "omni-moderation-latest",
input: [
{
type: "text",
text: "Bitte prüfen, ob dieses Bild gegen Richtlinien verstößt",
},
{
type: "image_url",
image_url: {
url: "https://cdn.apimart.ai/files/1779955589195-wh950j4imqd.jpeg",
},
},
],
stream: false,
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
Verwenden Sie
omni-moderation-latest, um die Sicherheitsmoderation der Eingabeinhalte durchzuführen. Dieses Modell gehört zur Moderationsserie und ist nicht Teil der Bild-, Video- oder Audiogenerierungsserien.
curl --request POST \
--url https://api.apimart.ai/v1/moderations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "omni-moderation-latest",
"input": [
{
"type": "text",
"text": "Bitte prüfen, ob dieses Bild gegen Richtlinien verstößt"
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.apimart.ai/files/1779955589195-wh950j4imqd.jpeg"
}
}
],
"stream": false
}'
import requests
url = "https://api.apimart.ai/v1/moderations"
payload = {
"model": "omni-moderation-latest",
"input": [
{
"type": "text",
"text": "Bitte prüfen, ob dieses Bild gegen Richtlinien verstößt"
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.apimart.ai/files/1779955589195-wh950j4imqd.jpeg"
}
}
],
"stream": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/moderations";
const payload = {
model: "omni-moderation-latest",
input: [
{
type: "text",
text: "Bitte prüfen, ob dieses Bild gegen Richtlinien verstößt",
},
{
type: "image_url",
image_url: {
url: "https://cdn.apimart.ai/files/1779955589195-wh950j4imqd.jpeg",
},
},
],
stream: false,
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
Unterstützte Modelle
| Modell | Beschreibung | Unterstützte Eingaben |
|---|---|---|
omni-moderation-latest | Allgemeines Modell zur Inhaltsmoderation | Text, Bild, Text+Bild gemischt |
Authorizations
string
erforderlich
Alle Endpunkte erfordern eine Authentifizierung mit einem Bearer Token.API Key abrufen:Besuchen Sie die API-Key-Verwaltungsseite, um Ihren API Key zu erhalten.Fügen Sie den folgenden Header zur Anfrage hinzu:
Authorization: Bearer YOUR_API_KEY
Body
string
erforderlich
Name des Moderationsmodells.
omni-moderation-latest- Allgemeines Modell zur Inhaltsmoderation
string | string[] | object[]
erforderlich
Zu moderierende Inhalte. Unterstützt einfachen Text, Text-Arrays und Inhaltsblock-Arrays.Inhaltsblöcke können Folgendes enthalten:
text- Textinhaltsblockimage_url- Bild-URL-Inhaltsblock
boolean
Standard:"false"
Ob die Antwort gestreamt werden soll.
false: Nicht-Streaming-Antwort (Standard; aktuell nur dieser Wert unterstützt,truewird nicht unterstützt)
input-Anfragearten
Text+Bild gemischt
{
"model": "omni-moderation-latest",
"input": [
{
"type": "text",
"text": "Bitte prüfen, ob dieses Bild gegen Richtlinien verstößt"
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.apimart.ai/files/1779955589195-wh950j4imqd.jpeg"
}
}
],
"stream": false
}
Reiner Text (einzeln)
{
"model": "omni-moderation-latest",
"input": "I want to kill someone",
"stream": false
}
Reiner Text (Array)
{
"model": "omni-moderation-latest",
"input": [
"hello",
"I hate you"
],
"stream": false
}
Nur Bild (Bild-URL)
{
"model": "omni-moderation-latest",
"input": [
{
"type": "image_url",
"image_url": {
"url": "https://cdn.apimart.ai/files/1779955589195-wh950j4imqd.jpeg"
}
}
],
"stream": false
}
Nur Bild (base64 Data URI)
{
"model": "omni-moderation-latest",
"input": [
{
"type": "image_url",
"image_url": {
"url": "data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAA..."
}
}
],
"stream": false
}
Hinweise
- Wenn
inputein Inhaltsblock-Array ist, unterscheidet jedes Element den Inhaltstyp übertype. - Für die Bildmoderation werden öffentlich zugängliche URLs empfohlen. Bei Verwendung von base64 verwenden Sie das Standard-Data-URI-Format:
data:image/{format};base64,{data}. - Sofern nicht anders erforderlich, setzen Sie
stream: falseeinheitlich.