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="")
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
OpenClaw integrates seamlessly by overriding the standard OpenAI endpoint environment variables. Make sure to append /v1 to the base URL.
Linux / macOS (Terminal)
Windows (PowerShell)
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"
}