Skip to main content
Brainiall
Docs

Start with a working call

Three recipes. Each one is a real input, a real call, a sample response, and the error you will hit first.

Use cases

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

Toxicity check · 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

Spoken audio · 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

Pronunciation · 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.

Authentication

Every call uses the same header. Replace the placeholder with your key.

Authorization: Bearer YOUR_KEY
Base URLhttps://api.brainiall.com

NLP Suite Endpoints

Detect toxic, offensive, or harmful content in text.

Code sample
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"}'

Next: run this call now

Toxicity check

Make your first call now

Check whether a sentence is toxic. A label and a score come back.

One text call. The engine returns whether the sentence is toxic.

Endpoint
POST /v1/nlp/toxicity
Request
{
  "text": "This product is absolutely amazing"
}

Preparing your API key…

Code sample
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"}'
Ready-to-run collection
{
  "name": "Brainiall first call",
  "baseUrl": "https://api.brainiall.com",
  "authorization": "Bearer $BRAINIALL_API_KEY",
  "requests": [
    {
      "id": "pronunciation",
      "method": "POST",
      "path": "/v1/pronunciation/assess/base64",
      "url": "https://api.brainiall.com/v1/pronunciation/assess/base64",
      "body": {
        "audio": "UklGRmQBAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YUABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
        "text": "Hello world"
      }
    },
    {
      "id": "tts",
      "method": "POST",
      "path": "/v1/tts/synthesize",
      "url": "https://api.brainiall.com/v1/tts/synthesize",
      "body": {
        "text": "Hello, welcome.",
        "voice": "brainiall-aria"
      }
    },
    {
      "id": "nlp",
      "method": "POST",
      "path": "/v1/nlp/toxicity",
      "url": "https://api.brainiall.com/v1/nlp/toxicity",
      "body": {
        "text": "This product is absolutely amazing"
      }
    }
  ]
}

The same request, ready to paste outside this browser. Replace the placeholder with your key — the key is never shown here.

Brainiall Developer Portal