Documentation
Docs
Everything you need to call the Nano models from your own code. Start with a key, then send a request.
Quick start
1. Create a key on the Keys page. 2. Top up with Add Funds. 3. Send a request to the base URL.
https://console.lgteamai.xyz/api/v1Authentication
Send your key in the Authorization header as a Bearer token. Keys start with lg_sk_. A key is shown once, when you create it; we store only a hash. Revoke a key on the Keys page and it stops working at once.
Authorization: Bearer lg_sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Models
Use the id as the model value. GET /api/v1/models returns this list and needs no key.
Chat completions
POST /api/v1/chat/completions sends messages and returns one reply.
| Field | Type | Details |
|---|---|---|
model | string | One of the model ids above. Required. |
messages | array | 1 to 50 items with role (system, user or assistant) and content (up to 8,000 characters). Required. |
max_tokens | integer | 1 to 1,024. Default 256. |
temperature | number | 0 to 2. Default 0.6. |
stream | boolean | Streaming is not available yet. Leave it out or send false. |
Response
{
"id": "chatcmpl_9f2c…",
"object": "chat.completion",
"created": 1795118000,
"model": "nano-1.3-plus",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Hello! How can I help?" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21 }
}finish_reason is stop when the model finished and length when it reached max_tokens. The usage counts are the tokens you are charged for.
Errors
Errors come as JSON: { "error": { "message": "…", "code": "…" } }. The message says what to change.
| Status | Code | What to do |
|---|---|---|
| 400 | invalid_request | Check the fields above. |
| 401 | invalid_api_key | The key is missing, wrong or revoked. |
| 402 | insufficient_balance | Top up your balance and retry. |
| 429 | rate_limited | Wait a little and retry. |
| 502 / 503 | upstream_error | The model server is busy or offline. Retry later. |
Billing
You pay per token from a prepaid balance. A request is charged after the reply is written, using the tokens it used. Prices per one million tokens are on the Models page.
cost = (input_tokens × input_price + output_tokens × output_price) ÷ 1,000,000 Nano 1.3 Plus, 200 tokens in and 150 out: (200 × $0.066 + 150 × $0.104) ÷ 1,000,000 = $0.0000288
Top-ups are paid in USDT through X-Rocket Pay. Your balance updates when the payment is confirmed. A request that your balance cannot cover is refused with 402.
Limits
- The API allows 120 requests a minute per account.
- A prompt and the reply must fit the model's context: 8,192 tokens for Nano 1.3 Pro-Preview, 4,096 for Plus and 1,024 for Fast.
- Replies are at most 1,024 tokens.
- Small models make mistakes with facts and arithmetic. Check answers that matter.
Your data
We keep your login, a salted hash of your password, hashes of your API keys, your balance, your top-ups, and for each request the model, the time and the number of tokens. We do not store prompts or replies. Keep your keys secret: anyone with a key can spend your balance.
Contact
Questions about access, billing or the models: lep4ic@lgteamai.xyz.