Tạo text completion (legacy)
Tạo text completion (legacy)
Tạo text completion (legacy). Tương thích với [OpenAI Completions API](https://platform.openai.com/docs/api-reference/completions).
> **Legacy:** Endpoint này yêu cầu model có `mode: completion` (ví dụ: `gpt-3.5-turbo-instruct`). Hiện tại Trạm AI chưa deploy model nào với mode này. Hãy dùng `/v1/chat/completions` thay thế.
Authentication
AuthorizationBearer
API key làm bearer token. Tạo API key tại [Console](https://console.staging.tram.ai.vn/keys).
Request
This endpoint expects an object.
model
Model ID (yêu cầu model có mode: completion)
prompt
Text prompt
stream
Bật streaming (SSE)
temperature
Sampling temperature (0–2)
max_tokens
Số token tối đa trong response
top_p
Nucleus sampling
stop
Stop sequences
Response
Thành công
id
object
created
model
choices
usage
Errors
400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error
