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.
# 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.

# 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="")

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.

# 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)
export ANTHROPIC_BASE_URL="https://api.wiserlab.ai" export ANTHROPIC_API_KEY="wsl-..."
Windows (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)
export OPENAI_BASE_URL="https://api.wiserlab.ai/v1" export OPENAI_API_KEY="wsl-..."
Windows (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)
export OPENAI_API_BASE="https://api.wiserlab.ai/v1" export OPENAI_API_KEY="wsl-..."
Windows (PowerShell)
$env:OPENAI_API_BASE="https://api.wiserlab.ai/v1" $env:OPENAI_API_KEY="wsl-..."
4. OpenClaw

OpenClaw integrates seamlessly by overriding the standard OpenAI endpoint environment variables. Make sure to append /v1 to the base URL.

Linux / macOS (Terminal)
export OPENAI_BASE_URL="https://api.wiserlab.ai/v1" export OPENAI_API_KEY="wsl-..."
Windows (PowerShell)
$env:OPENAI_BASE_URL="https://api.wiserlab.ai/v1" $env:OPENAI_API_KEY="wsl-..."
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)
export OPENAI_BASE_URL="https://api.wiserlab.ai/v1" export OPENAI_API_KEY="wsl-..."
Windows (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:
{
  "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.