Tạo chat completion
Tạo chat completion
Tạo chat completion. Tương thích hoàn toàn với [OpenAI Chat Completions API](https://platform.openai.com/docs/api-reference/chat/create).
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 (ví dụ: Gemini 3.5 Flash, DeepSeek V4 Flash)
messages
Danh sách messages
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
tools
Danh sách tools cho function calling
response_format
Format response (JSON mode)
Response
Thành công
id
object
choices
usage
Errors
400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error
