API Documentation
OpenAI-compatible. Simple to integrate.
Quick Start
1. Get your API key from the Dashboard
2. Use any OpenAI SDK — just change the base URL:
import OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'https://platform.lenout.com/v1',
apiKey: 'lnai_...'
})
const res = await client.chat.completions.create({
model: 'lenout-model',
messages: [{ role: 'user', content: 'Hello!' }]
})
Base URL
https://platform.lenout.com/v1
Authentication
Include your API key in the Authorization header:
Authorization: Bearer lnai_your_key_here
POST /v1/chat/completions
Request
{
"model": "lenout-model",
"messages": [
{ "role": "system", "content": "You are helpful." },
{ "role": "user", "content": "Hello!" }
],
"temperature": 0.7,
"max_tokens": 1024
}
Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "lenout-model",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hi! I'm Lenout Model. How can I help?"
},
"finish_reason": "stop"
}],
"usage": { "prompt_tokens": 20, "completion_tokens": 10, "total_tokens": 30 }
}
GET /v1/models
List all available models. No authentication required.
curl https://platform.lenout.com/v1/models
Models
| Model | Provider | Input / 1M tok | Output / 1M tok | Context |
|---|---|---|---|---|
lenout-model |
Lenout | FREE | 1 Lencon | 8K |
gpt-4o-mini |
OpenAI | 15 L | 60 L | 128K |
gpt-4o |
OpenAI | 250 L | 1000 L | 128K |
claude-sonnet-4 |
Anthropic | 300 L | 1500 L | 200K |
claude-haiku-3.5 |
Anthropic | 80 L | 400 L | 200K |
L = Lencon · 1 USD = 10 Lencon
Errors
| Code | Status | Description |
|---|---|---|
| invalid_api_key | 401 | Key missing, invalid, or revoked |
| rate_limited | 429 | Too many requests |
| insufficient_balance | 402 | Not enough Lencon credits |
| model_not_found | 404 | Model not available |
| generation_failed | 502 | AI provider error |
cURL Example
curl https://platform.lenout.com/v1/chat/completions \
-H "Authorization: Bearer lnai_..." \
-H "Content-Type: application/json" \
-d '{"model":"lenout-model","messages":[{"role":"user","content":"Hello!"}]}'