API Documentation
Complete reference for all Brainiall APIs
Authentication
All endpoints accept any of these headers (use one):
Ocp-Apim-Subscription-Key: YOUR_KEY
Authorization: Bearer YOUR_KEY
api-key: YOUR_KEY
Base URL: https://api.brainiall.com
API Endpoint
https://api.brainiall.com/v1
OpenAI-compatible API. Works with any tool that supports custom OpenAI endpoints.
Coding Tools
Cline / Roo Code / Kilo Code
Settings > API Provider > OpenAI Compatible (or Brainiall if available)
Continue.dev
Add to ~/.continue/config.yaml (or config.json):
models:
- provider: openai
title: Brainiall (Claude Haiku)
model: claude-haiku-4-5
apiBase: https://api.brainiall.com/v1
apiKey: YOUR_KEY
Works with any model from /v1/models. Continue.dev OpenAI docs →
Cursor
Settings > Models > Add Model > OpenAI Compatible
Windsurf (Codeium)
Cascade > Settings > Add Custom Model
Aider
export OPENAI_API_BASE=https://api.brainiall.com/v1 export OPENAI_API_KEY=YOUR_KEY aider --model openai/claude-haiku-4-5
REST API
POST /v1/chat/completions
Generate a chat completion. Supports streaming, tools, and all OpenAI-compatible parameters.
curl https://api.brainiall.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-haiku-4-5",
"messages": [{"role": "user", "content": "Hello!"}]
}'
from openai import OpenAI
client = OpenAI(
base_url="https://api.brainiall.com/v1",
api_key="YOUR_KEY",
)
response = client.chat.completions.create(
model="claude-haiku-4-5",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.brainiall.com/v1",
apiKey: "YOUR_KEY",
});
const response = await client.chat.completions.create({
model: "claude-haiku-4-5",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);
GET /v1/models
List all available models and their pricing.
curl https://api.brainiall.com/v1/models \ -H "Authorization: Bearer YOUR_KEY"
Popular Models
| Model | Input $/MTok | Output $/MTok |
|---|---|---|
| claude-opus-4-6 | $5.00 | $25.00 |
| claude-sonnet-4-6 | $3.00 | $15.00 |
| claude-haiku-4-5 | $1.00 | $5.00 |
| deepseek-r1 | $1.35 | $5.40 |
| deepseek-v3 | $0.27 | $1.10 |
| llama-3.3-70b | $0.72 | $0.72 |
| nova-pro | $0.80 | $3.20 |
| nova-micro | $0.035 | $0.14 |
Full list: GET /v1/models — 113+ models available.
Flex pricing saves 50% on supported models.
Pronunciation assessment, speech-to-text, text-to-speech, and Whisper transcription.
POST /v1/pronunciation/assess/base64
Assess pronunciation accuracy from base64-encoded audio.
Request body:
{
"audio_base64": "<base64-audio>",
"text": "Hello world",
"language": "en-US"
}
Response:
{
"overall_score": 85.2,
"pronunciation_score": 82.0,
"fluency_score": 90.1,
"words": [...]
}
curl -X POST https://api.brainiall.com/v1/pronunciation/assess/base64 \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"audio_base64":"...","text":"Hello world","language":"en-US"}'
import httpx, base64
audio_b64 = base64.b64encode(open("audio.wav", "rb").read()).decode()
resp = httpx.post(
"https://api.brainiall.com/v1/pronunciation/assess/base64",
headers={"Authorization": "Bearer YOUR_KEY"},
json={"audio_base64": audio_b64, "text": "Hello world", "language": "en-US"},
)
print(resp.json())
const fs = require("fs");
const audio = fs.readFileSync("audio.wav").toString("base64");
const resp = await fetch("https://api.brainiall.com/v1/pronunciation/assess/base64", {
method: "POST",
headers: { "Authorization": "Bearer YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ audio_base64: audio, text: "Hello world", language: "en-US" }),
});
console.log(await resp.json());
POST /v1/stt/transcribe/base64
Transcribe speech to text from base64-encoded audio (Azure Speech Services).
Request body:
{
"audio_base64": "<base64-audio>",
"language": "en-US"
}
Response:
{
"text": "Hello world",
"confidence": 0.95
}
curl -X POST https://api.brainiall.com/v1/stt/transcribe/base64 \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"audio_base64":"...","language":"en-US"}'
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"])
const audio = require("fs").readFileSync("audio.wav").toString("base64");
const resp = await fetch("https://api.brainiall.com/v1/stt/transcribe/base64", {
method: "POST",
headers: { "Authorization": "Bearer YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ audio_base64: audio, language: "en-US" }),
});
console.log((await resp.json()).text);
POST /v1/tts/synthesize
Convert text to speech. Returns audio binary (WAV format).
Request body:
{
"text": "Hello, welcome!",
"voice": "en-US-JennyNeural"
}
Response:
Binary audio data (WAV) Content-Type: audio/wav
curl -X POST https://api.brainiall.com/v1/tts/synthesize \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Hello, welcome!","voice":"en-US-JennyNeural"}' \
--output speech.wav
POST /v1/tts/synthesize/stream
Streaming text-to-speech. Returns chunked audio for low-latency playback.
Same request body as /v1/tts/synthesize. Response: chunked audio stream (Transfer-Encoding: chunked).
GET /v1/tts/voices
List all available TTS voices with language and gender info.
curl https://api.brainiall.com/v1/tts/voices \ -H "Authorization: Bearer YOUR_KEY"
POST /v1/whisper/transcribe/base64
Transcribe audio using OpenAI Whisper (GPU-accelerated). Supports 99+ languages with automatic detection.
Request body:
{
"audio_base64": "<base64-audio>"
}
Response:
{
"text": "Hello world",
"language": "en",
"segments": [...]
}
curl -X POST https://api.brainiall.com/v1/whisper/transcribe/base64 \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"audio_base64":"..."}'
Text analysis APIs — toxicity detection, sentiment analysis, named entities, PII detection, and language identification. All endpoints accept {"text": "..."} and respond in <200ms.
POST /v1/nlp/toxicity $0.001/request
Detect toxic, offensive, or harmful content in text.
Request body:
{ "text": "This is amazing!" }
Response:
{
"is_toxic": false,
"score": 0.0012,
"label": "not_toxic"
}
curl -X POST https://api.brainiall.com/v1/nlp/toxicity \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"This product is absolutely amazing"}'
import httpx
resp = httpx.post(
"https://api.brainiall.com/v1/nlp/toxicity",
headers={"Authorization": "Bearer YOUR_KEY"},
json={"text": "This product is absolutely amazing"},
)
print(resp.json())
const resp = await fetch("https://api.brainiall.com/v1/nlp/toxicity", {
method: "POST",
headers: { "Authorization": "Bearer YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ text: "This product is absolutely amazing" }),
});
console.log(await resp.json());
POST /v1/nlp/sentiment $0.001/request
Analyze sentiment polarity (positive/negative) with confidence score.
Request body:
{ "text": "I love this product!" }
Response:
{
"label": "POSITIVE",
"score": 0.9987
}
curl -X POST https://api.brainiall.com/v1/nlp/sentiment \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"I love this product!"}'
import httpx
resp = httpx.post(
"https://api.brainiall.com/v1/nlp/sentiment",
headers={"Authorization": "Bearer YOUR_KEY"},
json={"text": "I love this product!"},
)
print(resp.json())
const resp = await fetch("https://api.brainiall.com/v1/nlp/sentiment", {
method: "POST",
headers: { "Authorization": "Bearer YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ text: "I love this product!" }),
});
console.log(await resp.json());
POST /v1/nlp/entities $0.002/request
Extract named entities (people, organizations, locations, etc.) from text.
Request body:
{ "text": "John works at Google" }
Response:
{
"entities": [
{"text":"John","label":"PER",
"start":0,"end":4,"score":0.99},
{"text":"Google","label":"ORG",
"start":14,"end":20,"score":0.98}
]
}
curl -X POST https://api.brainiall.com/v1/nlp/entities \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"John works at Google in Mountain View"}'
import httpx
resp = httpx.post(
"https://api.brainiall.com/v1/nlp/entities",
headers={"Authorization": "Bearer YOUR_KEY"},
json={"text": "John works at Google in Mountain View"},
)
print(resp.json())
const resp = await fetch("https://api.brainiall.com/v1/nlp/entities", {
method: "POST",
headers: { "Authorization": "Bearer YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ text: "John works at Google in Mountain View" }),
});
console.log(await resp.json());
POST /v1/nlp/pii $0.002/request
Detect personally identifiable information (email, phone, SSN, credit card, IP address).
Request body:
{ "text": "Email me at john@ex.com" }
Response:
{
"pii_detected": true,
"entities": [
{"text":"john@ex.com",
"type":"email",
"start":12,"end":23}
]
}
curl -X POST https://api.brainiall.com/v1/nlp/pii \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Contact me at john@example.com or 555-123-4567"}'
import httpx
resp = httpx.post(
"https://api.brainiall.com/v1/nlp/pii",
headers={"Authorization": "Bearer YOUR_KEY"},
json={"text": "Contact me at john@example.com or 555-123-4567"},
)
print(resp.json())
const resp = await fetch("https://api.brainiall.com/v1/nlp/pii", {
method: "POST",
headers: { "Authorization": "Bearer YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ text: "Contact me at john@example.com or 555-123-4567" }),
});
console.log(await resp.json());
POST /v1/nlp/language $0.0005/request
Detect the language of a given text with confidence score.
Request body:
{ "text": "Bonjour, comment allez-vous?" }
Response:
{
"language": "fr",
"confidence": 0.9995
}
curl -X POST https://api.brainiall.com/v1/nlp/language \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Bonjour, comment allez-vous?"}'
GPU-accelerated image processing — background removal (BiRefNet), upscaling (ESRGAN), and face restoration (GFPGAN). All endpoints accept and return base64-encoded images.
POST /v1/image/remove-background/base64 $0.005/image
Remove background from an image using BiRefNet. Returns transparent PNG.
Request body:
{
"image_base64": "<base64-image>"
}
Response:
{
"image_base64": "<result-png>"
}
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\"}"
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)
const fs = require("fs");
const img = fs.readFileSync("photo.jpg").toString("base64");
const resp = await fetch("https://api.brainiall.com/v1/image/remove-background/base64", {
method: "POST",
headers: { "Authorization": "Bearer YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ image_base64: img }),
});
const { image_base64 } = await resp.json();
fs.writeFileSync("result.png", Buffer.from(image_base64, "base64"));
POST /v1/image/upscale/base64 $0.003/image
Upscale an image using Real-ESRGAN. Supports 2x and 4x scale factors.
Request body:
{
"image_base64": "<base64-image>",
"scale": 2
}
Response:
{
"image_base64": "<upscaled-image>"
}
curl -X POST https://api.brainiall.com/v1/image/upscale/base64 \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"image_base64":"...","scale":2}'
POST /v1/image/restore-face/base64 $0.005/image
Restore and enhance faces in photos using GFPGAN. Improves clarity, fixes artifacts.
Request body:
{
"image_base64": "<base64-image>"
}
Response:
{
"image_base64": "<restored-image>"
}
curl -X POST https://api.brainiall.com/v1/image/restore-face/base64 \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"image_base64":"..."}'