DocsAPI reference
Completions
POST /v1/completions — plain text completion without a chat template, for prompts you format yourself.
HTTP
POST https://osarai.xyz/v1/completionsThe legacy OpenAI completions format: the model continues the prompt as raw text, with no chat template. Use it when you build prompts yourself, for benchmarks or for few-shot text continuation. For conversations, use Chat Completions.
Request
Terminal
curl "https://osarai.xyz/v1/completions" \
-H "Authorization: Bearer $OSARAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8-27b",
"prompt": "The three primary colours are",
"max_tokens": 32,
"temperature": 0
}'Python
from openai import OpenAI
import os
client = OpenAI(base_url="https://osarai.xyz/v1", api_key=os.environ["OSARAI_API_KEY"])
result = client.completions.create(
model="qwen3.8-27b",
prompt="The three primary colours are",
max_tokens=32,
temperature=0,
)
print(result.choices[0].text)| Field | Notes |
|---|---|
model | Your instance's model id |
prompt | A string, or a list of strings for a batch |
max_tokens | Answer length cap, up to the model's max output |
stream | Stream text_completion chunks |
temperature, top_p, top_k, stop, seed, n | Sampling, as in Chat Completions |
echo | Return the prompt with the completion |
logprobs | Log probabilities of the top tokens |
Request bodies can be up to 16 MiB.
Response
JSON
{
"id": "cmpl-4d2a91",
"object": "text_completion",
"model": "qwen3.8-27b",
"choices": [{ "index": 0, "text": " red, yellow and blue.", "finish_reason": "stop" }],
"usage": { "prompt_tokens": 6, "completion_tokens": 7, "total_tokens": 13 }
}