Skip to content
NorthstarPlatformPricingLogin

Chat

Create Chat Completion
client.chat.createCompletion(ChatCreateCompletionParams { messages, add_generation_prompt, add_special_tokens, 52 more } body, RequestOptionsoptions?): ChatCreateCompletionResponse
POST/chat/completions
ModelsExpand Collapse
ChatCompletionContentPartAudio { input_audio, type }

Learn about audio inputs.

input_audio: InputAudio { data, format }
data: string
format: "wav" | "mp3"
One of the following:
"wav"
"mp3"
type: "input_audio"
ChatCompletionContentPartImage { image_url, type }

Learn about image inputs.

image_url: ImageURL { url, detail }
url: string
detail?: "auto" | "low" | "high"
One of the following:
"auto"
"low"
"high"
type: "image_url"
ChatCompletionContentPartRefusal { refusal, type }
refusal: string
type: "refusal"
ChatCompletionContentPartText { text, type }

Learn about text inputs.

text: string
type: "text"
ChatCompletionMessageFunctionToolCall { id, function, type }

A call to a function tool created by the model.

id: string
function: Function { arguments, name }

The function that the model called.

arguments: string
name: string
type: "function"
File { file, type }

Learn about file inputs for text generation.

file: File { file_data, file_id, filename }
file_data?: string
file_id?: string
filename?: string
type: "file"
Message { author, channel, content, 2 more }
author: Author { role, name }
role: "user" | "assistant" | "system" | 2 more

The role of a message author (mirrors chat::Role).

One of the following:
"user"
"assistant"
"system"
"developer"
"tool"
name?: string | null
channel?: string | null
content?: Array<unknown>
content_type?: string | null
recipient?: string | null