Chat completions

View as Markdown

OpenAI-compatible chat completions endpoint. Supports streaming via stream=true.

Authentication

AuthorizationBearer

API key passed as Authorization: Bearer token.

Request

This endpoint expects an object.
modelstringRequired
messageslist of objectsRequired
streambooleanOptionalDefaults to false
temperaturedoubleOptionalDefaults to 0.7
max_tokensintegerOptional
top_pdoubleOptional
frequency_penaltydoubleOptional
presence_penaltydoubleOptional

Response

Completion or SSE stream
idstringOptional
objectstringOptional
createdintegerOptional
modelstringOptional
choiceslist of objectsOptional
usageobjectOptional

Errors

401
Unauthorized Error
402
Payment Required Error
503
Service Unavailable Error