First API Call in 60 Seconds
3 steps. Copy-paste examples. No boilerplate.
1
2
3
Make your first call
Replace YOUR_KEY with your API key and run:
Detect toxicity in text. Fastest endpoint — ~20ms response time.
curl -X POST https://api.brainiall.com/v1/nlp/toxicity \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"You are an amazing person!"}'
import httpx
resp = httpx.post(
"https://api.brainiall.com/v1/nlp/toxicity",
headers={"Authorization": "Bearer YOUR_KEY"},
json={"text": "You are an amazing person!"},
)
print(resp.json())
Expected response:
{
"toxic": false,
"score": 0.0003,
"label": "not toxic"
}
Chat with 33+ AI models via OpenAI-compatible API. Works with any OpenAI SDK.
curl https://api.brainiall.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nova-micro",
"messages": [{"role": "user", "content": "What is the capital of France?"}]
}'
from openai import OpenAI
client = OpenAI(
base_url="https://api.brainiall.com/v1",
api_key="YOUR_KEY",
)
response = client.chat.completions.create(
model="nova-micro",
messages=[{"role": "user", "content": "What is the capital of France?"}],
)
print(response.choices[0].message.content)
Expected response:
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "nova-micro",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "The capital of France is Paris."
},
"finish_reason": "stop"
}],
"usage": {"prompt_tokens": 14, "completion_tokens": 8, "total_tokens": 22}
}
Text-to-speech and speech-to-text. TTS returns audio binary, STT accepts base64 audio.
curl -X POST https://api.brainiall.com/v1/tts/synthesize \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Hello, welcome to Brainiall!","voice":"en-US-JennyNeural"}' \
--output speech.wav
import httpx, base64
audio_b64 = base64.b64encode(open("audio.wav", "rb").read()).decode()
resp = httpx.post(
"https://api.brainiall.com/v1/stt/transcribe/base64",
headers={"Authorization": "Bearer YOUR_KEY"},
json={"audio_base64": audio_b64, "language": "en-US"},
)
print(resp.json()["text"])
Expected response (TTS):
Binary audio file saved to speech.wav Content-Type: audio/wav
Expected response (STT):
{
"text": "Hello world",
"confidence": 0.95
}
GPU-powered image processing. Background removal, upscaling, face restoration. All via base64.
IMG=$(base64 -i photo.jpg)
curl -X POST https://api.brainiall.com/v1/image/remove-background/base64 \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d "{\"image_base64\":\"$IMG\"}" | jq -r .image_base64 | base64 -d > result.png
import httpx, base64
img_b64 = base64.b64encode(open("photo.jpg", "rb").read()).decode()
resp = httpx.post(
"https://api.brainiall.com/v1/image/remove-background/base64",
headers={"Authorization": "Bearer YOUR_KEY"},
json={"image_base64": img_b64},
timeout=30,
)
result = base64.b64decode(resp.json()["image_base64"])
open("result.png", "wb").write(result)
print("Saved result.png")
Expected response:
{
"image_base64": "<base64-encoded-transparent-PNG>"
}