JavaScript
const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: JSON.stringify({ model: '<string>', input: '<string>', meta: false, debug: { enabled: true, return_upstream_request: true, return_upstream_response: true, trace: true, trace_level: 'summary' }, provider: { order: ['<string>'], only: ['<string>'], ignore: ['<string>'], include_alpha: true } }) }; fetch('https://api.phaseo.app/v1/moderations', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
{ "id": "<string>", "model": "<string>", "results": [ { "flagged": true, "categories": { "hate": true, "hate/threatening": true, "harassment": true, "harassment/threatening": true, "self-harm": true, "self-harm/intent": true, "self-harm/instructions": true, "sexual": true, "sexual/minors": true, "violence": true, "violence/graphic": true }, "category_scores": { "hate": 123, "hate/threatening": 123, "harassment": 123, "harassment/threatening": 123, "self-harm": 123, "self-harm/intent": 123, "self-harm/instructions": 123, "sexual": 123, "sexual/minors": 123, "violence": 123, "violence/graphic": 123 } } ] }
Classifies if text violates OpenAI’s usage policies.
Bearer token authentication
Gateway debug controls. These flags are never forwarded upstream.
Show child attributes
Provider routing preferences for gateway selection.
Moderation response
Was this page helpful?