Zum Hauptinhalt springen
Brainiall
Dokumentation

Beginnen Sie mit einem funktionierenden Aufruf

Drei Rezepte. Jedes hat eine echte Eingabe, einen Aufruf, eine Beispielantwort und den ersten Fehler, den Sie sehen.

Anwendungsfälle

Prüfen, ob ein Satz toxisch ist

Sie haben Nutzertext und brauchen ein Ja/Nein-Signal vor der Anzeige.

Eingabe

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

Aufruf

Toxizitätsprüfung · Aufruf
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"}'

Beispielantwort

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

Leerer Text wird abgelehnt. Senden Sie ein nicht leeres Feld text und versuchen Sie es erneut.

Einen Satz sprechen

Sie haben Wörter und brauchen Audio zum Abspielen oder Speichern.

Eingabe

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

Aufruf

Gesprochenes Audio · Aufruf
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

Beispielantwort

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

Leerer Text wird abgelehnt. Senden Sie ein nicht leeres Feld text. Die Stimme muss eine Katalog-ID aus GET /v1/tts/voices sein.

Einen gesprochenen Satz bewerten

Jemand hat einen Satz gesprochen. Sie brauchen eine Bewertung gegen den Referenztext.

Eingabe

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

Aufruf

Aussprache · Aufruf
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"}'

Beispielantwort

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

Ohne Audio wird abgelehnt. Senden Sie Base64-Audio im Feld audio plus den Referenztext.

Authentifizierung

Jeder Aufruf nutzt denselben Header. Ersetzen Sie den Platzhalter durch Ihren Schlüssel.

Autorisierung: Bearer YOUR_KEY
Basis URLhttps://api.brainiall.com

NLP Suite Endpunkte

Detect toxic, offensive, or harmful content in text.

Codebeispiel
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"}'

Weiter: diesen Aufruf jetzt ausführen

Toxizitätsprüfung

Machen Sie jetzt Ihren ersten Aufruf

Prüfen Sie, ob ein Satz toxisch ist. Es kommen ein Label und eine Punktzahl zurück.

Ein Textaufruf. Die Engine sagt, ob der Satz toxisch ist.

Endpunkt
POST /v1/nlp/toxicity
Anfrage
{
  "text": "This product is absolutely amazing"
}

Ihr API-Schlüssel wird vorbereitet…

Codebeispiel
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"}'
Sofort ausführbare Sammlung
{
  "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"
      }
    }
  ]
}

Dieselbe Anfrage, bereit zum Einfügen außerhalb dieses Browsers. Ersetzen Sie den Platzhalter durch Ihren Schlüssel — der Schlüssel wird hier nie angezeigt.

Brainiall-Entwicklerportal