curl --request POST \
--url 'https://api.elkapi.com/v1/moderations' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"input": "今天天气真好,适合出去散步。",
"model": "gpt-5.5"
}'
import requests
url = "https://api.elkapi.com/v1/moderations"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"input": "今天天气真好,适合出去散步。",
"model": "gpt-5.5"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/moderations";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"input": "今天天气真好,适合出去散步。",
"model": "gpt-5.5"
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"id": "id",
"model": "gpt-5.5",
"results": [
{
"flagged": false,
"categories": {},
"category_scores": {}
}
]
}
原生 OpenAI 格式
创建审查
- 检查文本内容是否违反使用政策
POST
/
v1
/
moderations
curl --request POST \
--url 'https://api.elkapi.com/v1/moderations' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"input": "今天天气真好,适合出去散步。",
"model": "gpt-5.5"
}'
import requests
url = "https://api.elkapi.com/v1/moderations"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"input": "今天天气真好,适合出去散步。",
"model": "gpt-5.5"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/moderations";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"input": "今天天气真好,适合出去散步。",
"model": "gpt-5.5"
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"id": "id",
"model": "gpt-5.5",
"results": [
{
"flagged": false,
"categories": {},
"category_scores": {}
}
]
}
curl --request POST \
--url 'https://api.elkapi.com/v1/moderations' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"input": "今天天气真好,适合出去散步。",
"model": "gpt-5.5"
}'
import requests
url = "https://api.elkapi.com/v1/moderations"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"input": "今天天气真好,适合出去散步。",
"model": "gpt-5.5"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/moderations";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"input": "今天天气真好,适合出去散步。",
"model": "gpt-5.5"
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"id": "id",
"model": "gpt-5.5",
"results": [
{
"flagged": false,
"categories": {},
"category_scores": {}
}
]
}
Authorizations
string
必填
所有接口均需要使用 Bearer Token 进行认证。在请求头中添加:
Authorization: Bearer YOUR_API_KEY
Body
string or array<string>
必填
string
默认值:"gpt-5.5"
示例:
gpt-5.5Response
string
string
默认值:"gpt-5.5"
示例:
gpt-5.5⌘I