Skip to navigation

OpenAI-compatible chat completion

View as Markdown

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

JSON completion or SSE stream
idstringOptional
objectstringOptional
createdintegerOptional
modelstringOptional
choiceslist of objectsOptional
usageobjectOptional

Errors

401
Unauthorized Error
402
Payment Required Error
409
Conflict Error
503
Service Unavailable Error