POST /v1/chat/completions returns a model's reply to a list of messages, in the OpenAI chat completions format.
Make a request
curl
curl https://api.albastov.com/v1/chat/completions \
-H "Authorization: Bearer $ALBASTOV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8-27b",
"messages": [{"role": "user", "content": "Say hello in five words."}],
"chat_template_kwargs": {"enable_thinking": false},
"max_tokens": 50
}'Python
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.albastov.com/v1", api_key=os.environ["ALBASTOV_API_KEY"])
reply = client.chat.completions.create(
model="qwen3.8-27b",
messages=[{"role": "user", "content": "Say hello in five words."}],
extra_body={"chat_template_kwargs": {"enable_thinking": False}},
max_tokens=50,
)
print(reply.choices[0].message.content)JavaScript
const res = await fetch("https://api.albastov.com/v1/chat/completions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ALBASTOV_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "qwen3.8-27b",
messages: [{ role: "user", content: "Say hello in five words." }],
chat_template_kwargs: { enable_thinking: false },
max_tokens: 50,
}),
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const reply = await res.json();
console.log(reply.choices[0].message.content);{
"id": "chatcmpl-b50af0eb9c5d02d9",
"object": "chat.completion",
"created": 1793305215,
"model": "qwen3.8-27b",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "Hello there, my friend.", "reasoning": null},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 18,
"completion_tokens": 7,
"total_tokens": 25,
"prompt_tokens_details": {"cached_tokens": 0},
"completion_tokens_details": {"reasoning_tokens": 0}
}
}OpenAI compatibility
The OpenAI SDKs work with base_url set to https://api.albastov.com/v1 and an Albastov API key with the scope llm.
| Feature | Albastov API |
|---|---|
| Chat completions | POST /v1/chat/completions |
| Model list | GET /v1/models |
| Streaming | "stream": true, server-sent events |
| Tool calls | tools, tool_choice |
| JSON output | response_format with json_object or json_schema |
| Thinking | chat_template_kwargs.enable_thinking |
| Embeddings, image input, audio, legacy completions | Not supported |
Pick a model
| Need | Model |
|---|---|
| General chat, tools and JSON output, long context; the default | qwen3.8-27b |
| Faster answers for a few requests at once | qwen3.8-27b-fast |
| Answers without refusals, long context | qwen3.8-27b-uncensored |
| A larger mixture-of-experts model without refusals | qwen3.8-flash-next-abliterated |
| DeepSeek V4.1 Flash on short prompts | deepseek-v4.1-flash |
A request without model goes to qwen3.8-27b. GET /v1/models lists every model with its state.
Model loading
One model is loaded at a time, for every caller. A request for a model that is not loaded loads that model: requests already running on the previous model finish first, up to 120 s, then the requested model starts. Requests for the same model share one load. A loaded model unloads after 30 minutes without requests.
| Request | Result while the model loads |
|---|---|
Streamed, no X-LLM-Wait | Waits up to 1800 s; the stream sends : loading <model> comments from 10 s |
Not streamed, no X-LLM-Wait | Waits up to 80 s, then 503 model_loading |
X-LLM-Wait: N | Waits up to N seconds (at most 1800), then 503 model_loading |
X-LLM-Wait: 0 | 503 model_loading at once; the load continues |
503 model_loading carries Retry-After in seconds. Send the same request again after Retry-After, or poll
GET /v1/models until state is loaded, then send a batch.
Chat models share capacity with image generation and music generation. While an image or music job runs, a request for
a model that is not loaded waits in a queue; when the wait ends first, the response is 503 queued with position, the
number of requests ahead. A queued request keeps its place on retry. After 900 s in the queue, the response is
503 gpu-busy. An image or music job that has waited 300 s behind chat requests runs next: new requests for the loaded
model wait behind the job, then the model loads again.
Limits
| Limit | Value |
|---|---|
| Models loaded at once | 1 |
| Context length | Per model, prompt plus output: context_length in GET /v1/models |
| Parallel requests per account | Per model: capabilities.max_parallel in GET /v1/models |
| Non-streamed response time | About 100 s, then 524; stream longer requests |
| Request body | 32 MB |
| Conversation state | None; send the full conversation on every request |
| Prompt and reply storage | None; token counts only |
| Input and output | Text only |
Account calls per minute and per day, and member tokens per day: Rate limits.
Reference
- Chat completions reference: parameters, headers, response
and errors of
POST /v1/chat/completions. - List models reference:
GET /v1/models.