Skip to navigation

Tạo chat completion

Tạo chat completion. Tương thích hoàn toàn với OpenAI Chat Completions API.

Authentication

AuthorizationBearer

API key làm bearer token. Tạo API key tại Console.

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

idstringOptional
objectstringOptional
choiceslist of objectsOptional
usageobjectOptional

Errors

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