See if a sentence is toxic
You have user text and need a pass/fail signal before it is shown.
Input
{
"text": "This product is absolutely amazing"
}
Call
curl -X POST https://api.brainiall.com/v1/nlp/toxicity \
-H "Authorization: Bearer $BRAINIALL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"This product is absolutely amazing"}'
Sample response
{
"label": "not_toxic",
"score": 0.001
}
Empty text is rejected. Send a non-empty text field and retry.
Speak a sentence
You have words and need audio you can play or store.
Input
{
"text": "Hello, welcome.",
"voice": "brainiall-aria"
}
Call
curl -X POST https://api.brainiall.com/v1/tts/synthesize \
-H "Authorization: Bearer $BRAINIALL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Hello, welcome.","voice":"brainiall-aria"}' \
--output speech.wav
Sample response
{
"content_type": "audio/wav",
"note": "Binary audio. Save the body to speech.wav."
}
Empty text is rejected. Send a non-empty text field. Voice must be a catalog id from GET /v1/tts/voices.
Score a spoken sentence
A learner spoke a sentence. You need a score against the reference text.
Input
{
"audio": "<base64-wav>",
"text": "Hello world"
}
Call
curl -X POST https://api.brainiall.com/v1/pronunciation/assess/base64 \
-H "Authorization: Bearer $BRAINIALL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"audio":"<base64-wav>","text":"Hello world"}'
Sample response
{
"overallScore": 86,
"sentenceScore": 84,
"decodedTranscript": "Hello world",
"words": [
{ "word": "Hello", "score": 90 },
{ "word": "world", "score": 82 }
]
}
Missing audio is rejected. Send base64 audio in the audio field plus the reference text.