Text Completions (Legacy)
The classic text-in → text-out completion endpoint (no conversation structure). For new projects, prefer Chat Completions.
RequestREQUEST
POST
https://test.kailin.com.cn/v1/completionsResponseRESPONSE
Fill in the request and hit Send — the response shows up here
Request
curl https://test.kailin.com.cn/v1/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-token" \
-d '{
"model": "gpt-3.5-turbo-instruct",
"prompt": "Three keywords about artificial intelligence:",
"max_tokens": 30,
"temperature": 0.8
}'
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Must be a completion-style model |
prompt | string / array | Yes | Text to continue; pass an array for batch requests |
stream | boolean | No | Stream output (SSE), default false |
max_tokens | number | No | Max tokens to generate |
temperature | number | No | Sampling temperature 0–2 |
top_p | number | No | Nucleus sampling |
n | integer | No | Number of completions to generate |
stop | string / array | No | Stop sequences |
echo | boolean | No | Echo the prompt back in the result |
logprobs | integer | No | Return per-token log probabilities (max 5) |
frequency_penalty / presence_penalty | number | No | Repetition penalties |
seed | integer | No | Random seed |
Response
{
"id": "cmpl-xxx",
"object": "text_completion",
"created": 1730000000,
"model": "gpt-3.5-turbo-instruct",
"choices": [
{
"index": 0,
"text": " deep learning, neural networks, and natural language processing.",
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 18,
"total_tokens": 30
}
}
caution
Not every channel offers completion-style models. If the model name errors out, check the available list with GET /v1/models first.