Preferences API
Manage user AI mode preferences. AI modes control model selection, temperature, and behavior across the platform. Modes can be set globally or per-workspace. Available modes: economy, balanced, quality, max, speed, and custom. All endpoints require JWT authentication.
Base path: /api/v2/preferences
/api/v2/preferences/ai-modeAuthenticatedGet the current AI mode for the authenticated user. Optionally scoped to a workspace.
Query Parameters
workspaceIdstringUUID of the workspace. Returns workspace-specific mode if set, otherwise global mode.
Request
400">curl -X 400">GET 400">class="text-emerald-400">"https:400">class="text-zinc-500">//api.lvng.ai/api/v2/preferences/ai-mode?workspaceId=ws_abc123" \
-H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"Response 200
{
400">class="text-emerald-400">"success": true,
400">class="text-emerald-400">"mode": {
400">class="text-emerald-400">"name": 400">class="text-emerald-400">"balanced",
400">class="text-emerald-400">"model": 400">class="text-emerald-400">"claude-sonnet",
400">class="text-emerald-400">"temperature": 0.7,
400">class="text-emerald-400">"maxTokens": 4096,
400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Good balance of quality and speed"
}
}/api/v2/preferences/ai-modeAuthenticatedSet the AI mode for the authenticated user. Can be set globally or per-workspace.
Body Parameters
modestringrequiredMode name: "economy", "balanced", "quality", "max", "speed", or "custom".
workspaceIdstringUUID of the workspace to set mode for. Omit for global setting.
customConfigobjectCustom configuration when mode is "custom". Allows setting model, temperature, etc.
Request
400">curl -X 400">PATCH https:400">class="text-zinc-500">//api.lvng.ai/api/v2/preferences/ai-mode \
-H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
-H 400">class="text-emerald-400">"Content-Type: application/json" \
-d '{
400">class="text-emerald-400">"mode": 400">class="text-emerald-400">"quality",
400">class="text-emerald-400">"workspaceId": 400">class="text-emerald-400">"ws_abc123"
}'Response 200
{
400">class="text-emerald-400">"success": true,
400">class="text-emerald-400">"mode": {
400">class="text-emerald-400">"name": 400">class="text-emerald-400">"quality",
400">class="text-emerald-400">"model": 400">class="text-emerald-400">"claude-opus",
400">class="text-emerald-400">"temperature": 0.5,
400">class="text-emerald-400">"maxTokens": 8192,
400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Maximum quality, slower responses"
}
}/api/v2/preferences/ai-modesAuthenticatedList all available AI modes with their configurations.
Request
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/preferences/ai-modes \
-H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"Response 200
{
400">class="text-emerald-400">"success": true,
400">class="text-emerald-400">"modes": [
{
400">class="text-emerald-400">"name": 400">class="text-emerald-400">"economy",
400">class="text-emerald-400">"model": 400">class="text-emerald-400">"claude-haiku",
400">class="text-emerald-400">"temperature": 0.7,
400">class="text-emerald-400">"maxTokens": 2048,
400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Fast and affordable for simple tasks"
},
{
400">class="text-emerald-400">"name": 400">class="text-emerald-400">"balanced",
400">class="text-emerald-400">"model": 400">class="text-emerald-400">"claude-sonnet",
400">class="text-emerald-400">"temperature": 0.7,
400">class="text-emerald-400">"maxTokens": 4096,
400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Good balance of quality and speed"
},
{
400">class="text-emerald-400">"name": 400">class="text-emerald-400">"quality",
400">class="text-emerald-400">"model": 400">class="text-emerald-400">"claude-opus",
400">class="text-emerald-400">"temperature": 0.5,
400">class="text-emerald-400">"maxTokens": 8192,
400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Maximum quality, slower responses"
},
{
400">class="text-emerald-400">"name": 400">class="text-emerald-400">"max",
400">class="text-emerald-400">"model": 400">class="text-emerald-400">"claude-opus",
400">class="text-emerald-400">"temperature": 0.3,
400">class="text-emerald-400">"maxTokens": 16384,
400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Maximum capability with extended context"
},
{
400">class="text-emerald-400">"name": 400">class="text-emerald-400">"speed",
400">class="text-emerald-400">"model": 400">class="text-emerald-400">"claude-haiku",
400">class="text-emerald-400">"temperature": 0.9,
400">class="text-emerald-400">"maxTokens": 1024,
400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Fastest possible responses"
},
{
400">class="text-emerald-400">"name": 400">class="text-emerald-400">"custom",
400">class="text-emerald-400">"model": 400">class="text-emerald-400">"configurable",
400">class="text-emerald-400">"temperature": 400">class="text-emerald-400">"configurable",
400">class="text-emerald-400">"maxTokens": 400">class="text-emerald-400">"configurable",
400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Custom configuration"
}
]
}