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.

Security Notice: All API requests must be routed over HTTPS. Requests made over unencrypted HTTP will be rejected automatically by the platform.
HTTP Header
# Pass token in the HTTP Header Authorization: Bearer wsl-...

Base URL

All model interactions share a standardized public endpoint structure. Drop our endpoint into your existing SDKs to instantly access top-tier models.

Endpoint
# Primary API Endpoint https://api.wiserlab.ai

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.
POST /v1/chat/completions
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
  }'
Python (OpenAI SDK)
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.
POST /v1/audio/transcriptions
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"
Python (OpenAI SDK)
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.
POST /v1/audio/speech
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
Python (OpenAI SDK)
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).
POST /v1/audio/embeddings
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++"
Python (Voiceprint Extraction)
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)}")
POST /v1/audio/compare
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"
Realtime Stream 4. Realtime Voice Talk Mode (WebSockets)

For live interactive voice conversations, Wiser Lab supports the OpenAI Realtime duplex streaming protocol over WebSockets at: wss://api.wiserlab.ai/v1/realtime

Features include ultra-low sub-second latency, Voice Activity Detection (VAD), client interruptions (barge-in), and continuous audio streaming for autonomous agents like OpenClaw.

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.

SSE Event Stream
# Expected Stream Output Format data: {"choices":[{"delta":{"content":"Hi"}}]} data: {"choices":[{"delta":{"content":" there"}}]} data: [DONE]

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.

Persistence Notice: For Linux/macOS, add the 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)
bash / zsh
export ANTHROPIC_BASE_URL="https://api.wiserlab.ai" export ANTHROPIC_API_KEY="wsl-..."
Windows (PowerShell)
PowerShell
$env:ANTHROPIC_BASE_URL="https://api.wiserlab.ai" $env:ANTHROPIC_API_KEY="wsl-..."
Model Configuration Mapping: Claude Code requests 'claude-3-5-sonnet' by default. You must explicitly pass a Wiser Lab supported model using the CLI model flag:
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)
bash / zsh
export OPENAI_BASE_URL="https://api.wiserlab.ai/v1" export OPENAI_API_KEY="wsl-..."
Windows (PowerShell)
PowerShell
$env:OPENAI_BASE_URL="https://api.wiserlab.ai/v1" $env:OPENAI_API_KEY="wsl-..."
Model Configuration Mapping: OpenCode defaults to GPT-4 endpoints. To remap this, update your OpenCode configuration settings file (usually located at ~/.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)
bash / zsh
export OPENAI_API_BASE="https://api.wiserlab.ai/v1" export OPENAI_API_KEY="wsl-..."
Windows (PowerShell)
PowerShell
$env:OPENAI_API_BASE="https://api.wiserlab.ai/v1" $env:OPENAI_API_KEY="wsl-..."
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)
Linux / macOS (bash / zsh)
# Primary LLM inference export OPENAI_BASE_URL="https://api.wiserlab.ai/v1" export OPENAI_API_KEY="wsl-..." # Speech-to-Text (STT) for incoming voice messages export OPENCLAW_STT_MODEL="faster-whisper-large-v3" # Text-to-Speech (TTS) for outgoing voice notes export OPENAI_TTS_BASE_URL="https://api.wiserlab.ai/v1" export OPENAI_TTS_API_KEY="wsl-..." export OPENAI_TTS_MODEL="kokoro" export OPENCLAW_VOICE_ENABLED="true" # Realtime Talk Mode export OPENCLAW_TALK_ENABLED="true"
Windows (PowerShell)
# Primary LLM inference $env:OPENAI_BASE_URL="https://api.wiserlab.ai/v1" $env:OPENAI_API_KEY="wsl-..." # Speech-to-Text (STT) for incoming voice messages $env:OPENCLAW_STT_MODEL="faster-whisper-large-v3" # Text-to-Speech (TTS) for outgoing voice notes $env:OPENAI_TTS_BASE_URL="https://api.wiserlab.ai/v1" $env:OPENAI_TTS_API_KEY="wsl-..." $env:OPENAI_TTS_MODEL="kokoro" $env:OPENCLAW_VOICE_ENABLED="true" # Realtime Talk Mode $env:OPENCLAW_TALK_ENABLED="true"
Tip — Thinking Models vs. Instant Chat: For agentic coding tools like OpenCode, use 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.
Full OpenClaw Configuration (~/.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)
bash / zsh
export OPENAI_BASE_URL="https://api.wiserlab.ai/v1" export OPENAI_API_KEY="wsl-..."
Windows (PowerShell)
PowerShell
$env:OPENAI_BASE_URL="https://api.wiserlab.ai/v1" $env:OPENAI_API_KEY="wsl-..."
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.

Configuration Steps:
  1. Open Cursor Settings (Cmd/Ctrl + Shift + J).
  2. Navigate to Models > OpenAI.
  3. Enter your Wiser Lab key in the OpenAI API Key field.
  4. Enable Override OpenAI Base URL and enter: https://api.wiserlab.ai/v1
  5. 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.

Configuration Steps:
  1. Open the Continue extension in your IDE and click the gear icon to open config.json.
  2. Locate the "models" array and add the following JSON object:
config.json
{
  "title": "Wiser Lab",
  "provider": "openai",
  "model": "wiser-core-ultra",
  "apiKey": "wsl-...",
  "apiBase": "https://api.wiserlab.ai/v1"
}
We use cookies to securely maintain your session, analyze our traffic, and improve your experience. By continuing to use our site, you agree to our Privacy Policy and Terms of Service.