Quick Start
Go from zero to your first LVNG API call in under five minutes. This guide walks you through getting an API key and sending your first request using curl.
Prerequisites
- ✓An LVNG account -- sign up at lvng.ai if you don't have one.
- ✓A terminal with
curlavailable.
1. Get Your API Key
Every request to the LVNG API must be authenticated. The fastest way to get started is with an API key.
- Sign in to your dashboard at lvng.ai.
- Navigate to Settings > API Keys.
- Click Generate New Key.
- Copy the key and store it somewhere safe. You will not be able to see it again.
API keys follow this format, where the token portion is 32-64 random characters:
vtron_cust_{customerId}_{token}Important: Treat your API key like a password. Never commit it to version control or expose it in client-side code. Use environment variables instead.
2. Configure Your Environment
Set your API key as an environment variable so you can reference it in commands.
# .env (add to .gitignore)
LVNG_API_KEY=vtron_cust_abc123_sk_live_9f8e7d6c5b4a3210fedcba98
# Base URL for all API requests
LVNG_API_URL=https:400">class="text-zinc-500">//api.lvng.ai/apiOr export directly in your terminal:
400">export LVNG_API_KEY=400">class="text-emerald-400">"vtron_cust_abc123_sk_live_9f8e7d6c5b4a3210fedcba98"3. Make Your First API Call
Send a message to the LVNG chat endpoint. The base URL for all API requests is https://api.lvng.ai/api.
Using curl
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v1/chat \
-H 400">class="text-emerald-400">"x-api-key: $LVNG_API_KEY" \
-H 400">class="text-emerald-400">"Content-Type: application/json" \
-d '{
400">class="text-emerald-400">"message": 400">class="text-emerald-400">"Hello, LVNG!",
400">class="text-emerald-400">"platform": 400">class="text-emerald-400">"api"
}'Response
{
400">class="text-emerald-400">"reply": 400">class="text-emerald-400">"Hello! I'm LVNG, your AI assistant. How can I help you today?",
400">class="text-emerald-400">"metadata": {
400">class="text-emerald-400">"toolsUsed": [],
400">class="text-emerald-400">"model": 400">class="text-emerald-400">"sonnet",
400">class="text-emerald-400">"responseTime": 1243
}
}Using Node.js (fetch)
No SDK is required. Use the standard fetch API available in Node.js 18+.
400">const response = 400">await fetch(400">class="text-emerald-400">'https:400">class="text-zinc-500">//api.lvng.ai/api/v1/chat', {
method: 400">class="text-emerald-400">'POST',
headers: {
400">class="text-emerald-400">'x-api-key': process.env.LVNG_API_KEY,
400">class="text-emerald-400">'Content-Type': 400">class="text-emerald-400">'application/json',
},
body: JSON.stringify({
message: 400">class="text-emerald-400">'Hello, LVNG!',
platform: 400">class="text-emerald-400">'api',
}),
})
400">const data = 400">await response.json()
console.log(data.reply)
400">class="text-zinc-500">// => 400">class="text-emerald-400">"Hello! I'm LVNG, your AI assistant. How can I help you today?"
console.log(data.metadata)
400">class="text-zinc-500">// => { toolsUsed: [], model: 400">class="text-emerald-400">"sonnet", responseTime: 1243 }Using Python (requests)
400">import os
400">import requests
response = requests.post(
400">class="text-emerald-400">"https:400">class="text-zinc-500">//api.lvng.ai/api/v1/chat",
headers={
400">class="text-emerald-400">"x-api-key": os.environ[400">class="text-emerald-400">"LVNG_API_KEY"],
400">class="text-emerald-400">"Content-Type": 400">class="text-emerald-400">"application/json",
},
json={
400">class="text-emerald-400">"message": 400">class="text-emerald-400">"Hello, LVNG!",
400">class="text-emerald-400">"platform": 400">class="text-emerald-400">"api",
},
)
data = response.json()
print(data[400">class="text-emerald-400">"reply"])
print(data[400">class="text-emerald-400">"metadata"])SDKs
Coming soon: Official SDKs for TypeScript, Python, and Go are in development. In the meantime, the LVNG API is a standard REST API -- use any HTTP client in any language.
Authentication Methods
The examples above use API key authentication via the x-api-key header. The API also supports JWT tokens for browser-based applications and the Authorization: Bearer header for both methods. See the Authentication page for full details.
x-api-key: vtron_cust_...Backend services, scriptsAuthorization: Bearer <jwt>Browser apps, user sessionsNext Steps
Authentication
JWT tokens, API key formats, request context, and tenant isolation.
API Reference
Full endpoint reference for chat, agents, workflows, and more.
Rate Limits
Per-endpoint and per-plan rate limits, headers, and retry strategies.
Error Codes
HTTP and Socket.io error codes, response formats, and troubleshooting.