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.
modelstringRequired

Model ID (ví dụ: Gemini 3.5 Flash, DeepSeek V4 Flash)

messageslist of objectsRequired

Danh sách messages

streambooleanOptionalDefaults to false

Bật streaming (SSE)

temperaturedoubleOptional0-2

Sampling temperature (0–2)

max_tokensintegerOptional

Số token tối đa trong response

top_pdoubleOptional0-1
Nucleus sampling
stopstring or list of stringsOptional
Stop sequences
toolslist of objectsOptional

Danh sách tools cho function calling

response_formatobjectOptional

Format response (JSON mode)

Response

Thành công

idstring
objectstring
choiceslist of objects
usageobject

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error