Aller au contenu principal
Brainiall
Documentation

Commencez par un appel qui fonctionne

Trois recettes. Chacune a une entrée réelle, un appel, une réponse d’exemple et la première erreur que vous rencontrerez.

Cas d’usage

Voir si une phrase est toxique

Vous avez du texte utilisateur et besoin d’un signal passe/bloque avant affichage.

Entrée

{
  "text": "This product is absolutely amazing"
}

Appel

Contrôle de toxicité · Appel
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"}'

Réponse d’exemple

{
  "label": "not_toxic",
  "score": 0.001
}

Un texte vide est rejeté. Envoyez un champ text non vide et réessayez.

Prononcer une phrase

Vous avez des mots et besoin d’un audio à lire ou stocker.

Entrée

{
  "text": "Hello, welcome.",
  "voice": "brainiall-aria"
}

Appel

Audio parlé · Appel
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

Réponse d’exemple

{
  "content_type": "audio/wav",
  "note": "Binary audio. Save the body to speech.wav."
}

Un texte vide est rejeté. Envoyez un champ text non vide. La voix doit être un id du catalogue GET /v1/tts/voices.

Noter une phrase parlée

Quelqu’un a dit une phrase. Vous avez besoin d’une note par rapport au texte de référence.

Entrée

{
  "audio": "<base64-wav>",
  "text": "Hello world"
}

Appel

Prononciation · Appel
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"}'

Réponse d’exemple

{
  "overallScore": 86,
  "sentenceScore": 84,
  "decodedTranscript": "Hello world",
  "words": [
    { "word": "Hello", "score": 90 },
    { "word": "world", "score": 82 }
  ]
}

Sans audio, l’appel est rejeté. Envoyez l’audio en base64 dans le champ audio et le texte de référence.

Authentification

Chaque appel utilise le même en-tête. Remplacez le marqueur par votre clé.

Authorization: Bearer YOUR_KEY
URL de basehttps://api.brainiall.com

NLP Suite Endpoints

Detect toxic, offensive, or harmful content in text.

Exemple de code
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"}'

Suite : lancez cet appel maintenant

Contrôle de toxicité

Faites votre premier appel maintenant

Vérifiez si une phrase est toxique. Une étiquette et un score reviennent.

Un appel texte. Le moteur indique si la phrase est toxique.

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

Préparation de votre clé API…

Exemple de code
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"}'
Collection prête à lancer
{
  "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"
      }
    }
  ]
}

La même requête, prête à coller hors de ce navigateur. Remplacez le joker par votre clé — la clé n’est jamais affichée ici.

Portail développeur Brainiall