Skip to content

DocsAPI reference

Completions

POST /v1/completions — plain text completion without a chat template, for prompts you format yourself.

HTTP
POST https://osarai.xyz/v1/completions

The 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
  }'
FieldNotes
modelYour instance's model id
promptA string, or a list of strings for a batch
max_tokensAnswer length cap, up to the model's max output
streamStream text_completion chunks
temperature, top_p, top_k, stop, seed, nSampling, as in Chat Completions
echoReturn the prompt with the completion
logprobsLog 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 }
}