Skip to content

Language models

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

POST /v1/chat/completions at https://api.albastov.com/v1 returns a model's reply to a list of messages, in the OpenAI chat completions format, with streaming, tool calls, JSON output and thinking.

Quick example

A system message sets instructions for the whole conversation. The request asks qwen3.8-27b for the language code of the user's message, with thinking off.

curl

curl https://api.albastov.com/v1/chat/completions \
  -H "Authorization: Bearer $ALBASTAR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3.8-27b",
    "messages": [
      {"role": "system", "content": "Reply with one ISO 639-1 language code."},
      {"role": "user", "content": "Wie spät ist es?"}
    ],
    "chat_template_kwargs": {"enable_thinking": false},
    "max_tokens": 10
  }'

Python

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.albastov.com/v1",
    api_key=os.environ["ALBASTAR_API_KEY"],
)
reply = client.chat.completions.create(
    model="qwen3.8-27b",
    messages=[
        {"role": "system",
         "content": "Reply with one ISO 639-1 language code."},
        {"role": "user", "content": "Wie spät ist es?"},
    ],
    extra_body={"chat_template_kwargs": {"enable_thinking": False}},
    max_tokens=10,
)
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.ALBASTAR_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "qwen3.8-27b",
    messages: [
      { role: "system", content: "Reply with one ISO 639-1 language code." },
      { role: "user", content: "Wie spät ist es?" },
    ],
    chat_template_kwargs: { enable_thinking: false },
    max_tokens: 10,
  }),
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const reply = await res.json();
console.log(reply.choices[0].message.content);

The response, abridged to the reply (id, created and usage left out):

JSON
{
  "object": "chat.completion",
  "model": "qwen3.8-27b",
  "choices": [
    {
      "index": 0,
      "message": {"role": "assistant", "content": "de", "reasoning": null},
      "finish_reason": "stop"
    }
  ]
}

What you can build

Chat completions

Conversations with a system prompt, history, prompt caching and parallel requests.

Streaming

Replies token by token as server-sent events.

Tools and structured output

Function calls with tools, and JSON output that matches a schema.

Thinking

Reasoning before the answer, on or off per request.

Chat models

Every chat model with its context length, parallel requests, thinking switch and tool support.

Key concepts

OpenAI compatibility
The OpenAI SDKs work with base_url set to https://api.albastov.com/v1 and a key with the scope llm. Embeddings, image input, audio and legacy completions are not supported.
Model
model names one chat model. Without model, the request runs on qwen3.8-27b. GET /v1/models lists every model with its state and context_length.
Model loading
One chat model is loaded at a time across the API. A request for another model waits while that model loads, or returns 503 model_loading with Retry-After.
Thinking
Thinking is on by default; chat_template_kwargs.enable_thinking turns thinking off per request. The reasoning arrives in message.reasoning.
Conversation state
The API keeps none. Every request sends the whole conversation, up to the model's context_length tokens of prompt plus output.

Next steps

Quick start

A key, a first chat completion and its reply.

Authentication

Keys, the scope llm and the Authorization header.

Chat completions reference

Every parameter, header, response field and error of POST /v1/chat/completions.

List models reference

The fields and states of GET /v1/models.