Skip to main content
POST
/
guardrails
/
detect-audio
Analyze audio with text using individual multimodal guardrails detectors.
curl --request POST \
  --url https://api.enkryptai.com/guardrails/detect-audio \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '
{
  "text_input": "<string>",
  "audio_data": "<string>",
  "detectors": {
    "toxicity": {
      "enabled": true
    },
    "nsfw": {
      "enabled": true
    },
    "injection_attack": {
      "enabled": true
    },
    "pii": {
      "enabled": true,
      "entities": [
        "person",
        "phone",
        "email"
      ]
    },
    "policy_violation": {
      "enabled": true,
      "policy_text": "No violent or illegal content allowed.",
      "need_explanation": true
    }
  }
}
'
{ "summary": { "toxicity": 0, "injection_attack": 0 }, "details": { "toxicity": { "toxicity": "Toxicity Not Detected" }, "injection_attack": { "injection_attack": "Injection Attack Not Detected" } } }

Authorizations

apikey
string
header
required

Body

application/json
text_input
string
required

The text prompt to accompany the audio for analysis.

audio_data
string
required

Base64-encoded audio file content.

detectors
MultimodalDetectorsConfig · object
required

Configuration for multimodal detectors. Each key is a detector name with an object specifying its settings. Supported detectors: toxicity, nsfw, injection_attack, pii, policy_violation.

Example:
{
  "toxicity": { "enabled": true },
  "nsfw": { "enabled": true },
  "injection_attack": { "enabled": true },
  "pii": {
    "enabled": true,
    "entities": ["person", "phone", "email"]
  },
  "policy_violation": {
    "enabled": true,
    "policy_text": "No violent or illegal content allowed.",
    "need_explanation": true
  }
}

Response

200 - application/json

Multimodal audio detection results.

summary
object
required

Per-detector integer flags (1 = detected, 0 = not detected).

Example:
{
  "toxicity": 0,
  "nsfw": 0,
  "pii": 1,
  "injection_attack": 0,
  "policy_violation": 0
}
details
object
required

Per-detector detail objects containing human-readable results and any extra fields (e.g. entities for PII, explanation for policy_violation).

Example:
{
  "toxicity": { "toxicity": "Toxicity Not Detected" },
  "nsfw": { "nsfw": "NSFW Not Detected" },
  "pii": {
    "entities": { "person": { "John Doe": "<person_0>" } }
  },
  "injection_attack": {
    "injection_attack": "Injection Attack Not Detected"
  },
  "policy_violation": {
    "policy_violation": "Policy Violation Not Detected"
  }
}