Skip to content

Language models

OpenAI-compatible chat completions on open-weight Qwen and DeepSeek models.

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);
Response
{
  "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.

FeatureAlbastov API
Chat completionsPOST /v1/chat/completions
Model listGET /v1/models
Streaming"stream": true, server-sent events
Tool callstools, tool_choice
JSON outputresponse_format with json_object or json_schema
Thinkingchat_template_kwargs.enable_thinking
Embeddings, image input, audio, legacy completionsNot supported

Pick a model

NeedModel
General chat, tools and JSON output, long context; the defaultqwen3.8-27b
Faster answers for a few requests at onceqwen3.8-27b-fast
Answers without refusals, long contextqwen3.8-27b-uncensored
A larger mixture-of-experts model without refusalsqwen3.8-flash-next-abliterated
DeepSeek V4.1 Flash on short promptsdeepseek-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.

RequestResult while the model loads
Streamed, no X-LLM-WaitWaits up to 1800 s; the stream sends : loading <model> comments from 10 s
Not streamed, no X-LLM-WaitWaits up to 80 s, then 503 model_loading
X-LLM-Wait: NWaits up to N seconds (at most 1800), then 503 model_loading
X-LLM-Wait: 0503 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

LimitValue
Models loaded at once1
Context lengthPer model, prompt plus output: context_length in GET /v1/models
Parallel requests per accountPer model: capabilities.max_parallel in GET /v1/models
Non-streamed response timeAbout 100 s, then 524; stream longer requests
Request body32 MB
Conversation stateNone; send the full conversation on every request
Prompt and reply storageNone; token counts only
Input and outputText only

Account calls per minute and per day, and member tokens per day: Rate limits.

Reference