API Reference
Integrate Wiser Lab's secure, privacy-first AI platform into your autonomous agents and production environments with zero friction.
Authentication
The Wiser Lab API uses Bearer tokens to authenticate requests. You can generate and rotate these keys securely inside your Profile dashboard.
Base URL
All model interactions share a standardized public endpoint structure. Drop our endpoint into your existing SDKs to instantly access top-tier models.
Create Chat Completion
Send requests effortlessly using standard OpenAI-compatible JSON payloads. Wiser Lab dynamically validates credentials, protects your privacy, and executes models with ultra-low latency.
Request Parameters
| model | string — Required. The target AI model identifier (e.g., wiser-core-ultra). |
| messages | array — Required. A list of message objects representing the conversation history. |
| stream | boolean — Optional. Defaults to false. If true, server-sent events will be initialized. |
curl -X POST https://api.wiserlab.ai/v1/chat/completions \
-H "Authorization: Bearer wsl-..." \
-H "Content-Type: application/json" \
-d '{
"model": "wiser-core-ultra",
"messages": [
{"role": "user", "content": "Hello"}
],
"stream": true
}'
import openai
client = openai.OpenAI(
api_key="wsl-...",
base_url="https://api.wiserlab.ai/v1"
)
response = client.chat.completions.create(
model="wiser-core-ultra",
messages=[{"role": "user", "content": "Hello"}],
stream=True
)
for chunk in response:
print(chunk.choices[0].delta.content or "", end="")
Audio & Speech Intelligence
Wiser Lab provides dedicated, GPU-accelerated speech and audio intelligence fully compliant with OpenAI's audio specification. Easily transcribe spoken audio into text with high-fidelity punctuation, synthesize lifelike neural voice, or establish real-time conversational streaming loops.
1. Speech-to-Text (Transcriptions)
Transcribe audio files or voice memos into accurate text across dozens of languages using the GPU-accelerated faster-whisper-large-v3 model.
Request Parameters
| file | binary file — Required. The audio file object (e.g., mp3, wav, m4a, ogg, webm). |
| model | string — Required. Set to faster-whisper-large-v3. |
| response_format | string — Optional. Output format: json (default), text, verbose_json, srt, or vtt. |
| language | string — Optional. ISO-639-1 language code (e.g., en, es, zh). Auto-detected if omitted. |
curl -X POST https://api.wiserlab.ai/v1/audio/transcriptions \
-H "Authorization: Bearer wsl-..." \
-H "Content-Type: multipart/form-data" \
-F file="@voice_note.mp3" \
-F model="faster-whisper-large-v3"
from openai import OpenAI
client = OpenAI(
api_key="wsl-...",
base_url="https://api.wiserlab.ai/v1"
)
with open("voice_note.mp3", "rb") as audio_file:
transcript = client.audio.transcriptions.create(
model="faster-whisper-large-v3",
file=audio_file
)
print(transcript.text)
2. Text-to-Speech (TTS Synthesis)
Generate expressive, human-quality voice audio from text in real time with our GPU-accelerated kokoro neural voice engine (also accessible via alias tts-1).
Request Parameters
| model | string — Required. Set to kokoro or OpenAI alias tts-1. |
| input | string — Required. The text string to synthesize into speech. |
| voice |
string — Optional. Target voice identifier. Recommended:
af_heart (Warm American Female - Default)
af_bella (Expressive American Female) am_adam (Natural American Male) bf_emma (British Female) bm_george (British Male) |
| response_format | string — Optional. Audio encoding: mp3 (default), opus, aac, flac, wav, or pcm. |
curl -X POST https://api.wiserlab.ai/v1/audio/speech \
-H "Authorization: Bearer wsl-..." \
-H "Content-Type: application/json" \
-d '{
"model": "kokoro",
"voice": "af_heart",
"input": "Welcome to Wiser Lab. Your private autonomous AI platform is ready."
}' \
--output welcome.mp3
from openai import OpenAI
client = OpenAI(
api_key="wsl-...",
base_url="https://api.wiserlab.ai/v1"
)
response = client.audio.speech.create(
model="kokoro",
voice="af_heart",
input="Welcome to Wiser Lab. Your private autonomous AI platform is ready."
)
response.stream_to_file("welcome.mp3")
3. Speaker Vectorization & Diarization (Voiceprints)
Extract 192-dimensional normalized speaker voiceprint vectors from audio recordings using the lightweight, high-performance cam++ model (<5ms latency). Ideal for multi-speaker meeting diarization, speaker identification, and voice biometrics.
Request Parameters
| file | binary file — Required. The audio file object (e.g., wav, mp3, m4a, ogg, webm). Auto-resampled to 16kHz mono. |
| model | string — Required. Set to cam++. |
Turnkey Verification: Compare Two Speakers
To verify whether two audio samples belong to the same speaker without calculating cosine similarity client-side, dispatch to POST /v1/audio/compare:
| file1, file2 | binary file — Required. Two audio clips to compare. |
| threshold | float — Optional. Cosine similarity threshold (default: 0.65). |
curl -X POST https://api.wiserlab.ai/v1/audio/embeddings \
-H "Authorization: Bearer wsl-..." \
-H "Content-Type: multipart/form-data" \
-F file="@speaker_clip.wav" \
-F model="cam++"
import requests
url = "https://api.wiserlab.ai/v1/audio/embeddings"
headers = {"Authorization": "Bearer wsl-..."}
files = {"file": open("speaker_clip.wav", "rb")}
data = {"model": "cam++"}
resp = requests.post(url, headers=headers, files=files, data=data)
embedding = resp.json()["data"][0]["embedding"] # 192-dim vector
print(f"Vector dim: {len(embedding)}")
curl -X POST https://api.wiserlab.ai/v1/audio/compare \
-H "Authorization: Bearer wsl-..." \
-F file1="@speaker1.wav" \
-F file2="@speaker2.wav" \
-F threshold="0.65"
For live interactive voice conversations, Wiser Lab supports the OpenAI Realtime duplex streaming protocol over WebSockets at:
wss://api.wiserlab.ai/v1/realtime
Streaming Native Architecture
Wiser Lab's high-throughput, streaming-native architecture bypasses typical HTTP overhead. By toggling stream: true, responses are piped back with the ultra-low latency required for real-time applications and autonomous workforces.
Responses adhere strictly to the standard text/event-stream content protocol, ending execution sequences cleanly with a final data: [DONE] packet.
Error Codes
Our platform leverages explicit HTTP status headers alongside detailed JSON payloads to map exceptions gracefully.
| Status Code | Type | Description |
|---|---|---|
| 401 Unauthorized | invalid_api_key | The Bearer token passed is inactive, malformed, or missing entirely. |
| 405 Method Not Allowed | invalid_http_method | The targeted endpoint restricts mutations to POST. Review routing protocols. |
| 502 Bad Gateway | node_timeout | The platform encountered an upstream timeout or connection issue with the underlying AI model provider. |
Tool Integration
Wiser Lab acts as a drop-in replacement for standard API endpoints. You can easily configure popular coding assistants, agents, and CLI tools to route their requests through our secure platform by overriding their default environment variables. Below are detailed instructions for configuring OS variables and mapping supported models.
export commands to your ~/.bashrc or ~/.zshrc file to make them permanent. For Windows, configure them globally via your System Environment Variables GUI.
1. Claude Code
Claude Code natively utilizes Anthropic's SDK mapping. Override the base URL and pass your Wiser Lab key as the Anthropic key.
Linux / macOS (Terminal)
Windows (PowerShell)
claude --model wiser-core-ultra
2. OpenCode
OpenCode leverages OpenAI's routing schema. Ensure you append /v1 to the base URL parameter for full compatibility.
Linux / macOS (Terminal)
Windows (PowerShell)
~/.opencode/config.json) and set your desired default model:"default_model": "wiser-core-ultra"
3. Codex & Legacy OpenAI Tools
Some older generation tools like Codex utilize OPENAI_API_BASE instead of the modern base URL nomenclature.
Linux / macOS (Terminal)
Windows (PowerShell)
4. OpenClaw (Autonomous Agent, Voice Notes & Talk Mode)
OpenClaw is an autonomous AI agent framework supporting multi-channel messaging (Telegram, Web, CLI), Tool execution, Voice Note handling, and Realtime Talk Mode. Wiser Lab provides complete drop-in compatibility for reasoning, transcription, speech synthesis, and real-time streaming.
Environment Variables Setup (~/.openclaw/.env or Shell)
Qwen3.8-27B to enable full step-by-step reasoning. For interactive conversational agents and voice bots like OpenClaw, use Qwen3.8-27B-chat where the router automatically suppresses internal reasoning to deliver instant, zero-delay responses.
~/.openclaw/openclaw.json)
Paste the following configuration into your ~/.openclaw/openclaw.json file to enable chat intelligence, Kokoro voice synthesis, Whisper audio transcription, and duplex Talk Mode:
{
"models": {
"mode": "merge",
"providers": {
"wiserlab": {
"baseUrl": "https://api.wiserlab.ai/v1",
"apiKey": "wsl-...",
"api": "openai-completions",
"models": [
{
"id": "Qwen3.8-27B-chat",
"name": "Qwen3.8-27B-chat",
"contextWindow": 262144,
"maxTokens": 32768
},
{
"id": "kokoro",
"name": "kokoro",
"contextWindow": 1000,
"maxTokens": 4096
},
{
"id": "faster-whisper-large-v3",
"name": "faster-whisper-large-v3",
"contextWindow": 448,
"maxTokens": 448
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "wiserlab/Qwen3.8-27B-chat"
}
}
},
"tts": {
"auto": "inbound",
"provider": "wiserlab",
"providers": {
"wiserlab": {
"baseUrl": "https://api.wiserlab.ai/v1",
"apiKey": "wsl-...",
"model": "kokoro",
"voice": "af_heart"
}
}
},
"talk": {
"enabled": true,
"provider": "wiserlab",
"realtime": {
"provider": "openai",
"url": "wss://api.wiserlab.ai/v1/realtime",
"model": "faster-whisper-large-v3"
},
"silenceTimeoutMs": 1500,
"interruptOnSpeech": true
},
"tools": {
"media": {
"audio": {
"enabled": true
},
"models": [
{
"provider": "wiserlab",
"model": "faster-whisper-large-v3",
"baseUrl": "https://api.wiserlab.ai/v1"
}
]
}
}
}
Voice Notes in Messaging
When sending voice memos to OpenClaw via Telegram or Web chat, OpenClaw automatically submits the audio to faster-whisper-large-v3 for transcription. With tts.auto: 'inbound' configured, OpenClaw synthesizes an audio voice note response via kokoro alongside its text reply.
Interactive Talk Mode
Run openclaw talk in your terminal or click 'Talk' in the OpenClaw Gateway Control UI. This establishes an ultra-low latency, full-duplex WebSocket stream with Wiser Lab, enabling hands-free conversational voice dialogues with automatic speech interruption handling.
5. Hermes Agent
Hermes Agent allows configuring custom API base URLs. Set your environment variables to point to the Wiser Lab endpoint.
Linux / macOS (Terminal)
Windows (PowerShell)
6. Cursor IDE
Cursor allows you to directly override the OpenAI base URL in its settings GUI to route autocomplete and chat through Wiser Lab's models.
- Open Cursor Settings (
Cmd/Ctrl + Shift + J). - Navigate to Models > OpenAI.
- Enter your Wiser Lab key in the OpenAI API Key field.
- Enable Override OpenAI Base URL and enter:
https://api.wiserlab.ai/v1 - Under Model Names, add your desired Wiser Lab models (e.g.,
wiser-core-ultra) and select them in chat.
7. Continue.dev (VS Code / JetBrains)
Continue is a leading open-source AI code assistant. You can easily add Wiser Lab as a custom OpenAI-compatible provider by modifying your config.json.
- Open the Continue extension in your IDE and click the gear icon to open
config.json. - Locate the
"models"array and add the following JSON object:
{
"title": "Wiser Lab",
"provider": "openai",
"model": "wiser-core-ultra",
"apiKey": "wsl-...",
"apiBase": "https://api.wiserlab.ai/v1"
}