Skip to content
NorthstarPlatformPricingLogin

Chat

Create Chat Completion
POST/chat/completions
ModelsExpand Collapse
ChatCompletionContentPartAudio = object { input_audio, type }

Learn about audio inputs.

input_audio: object { data, format }
data: string
format: "wav" or "mp3"
One of the following:
"wav"
"mp3"
type: "input_audio"
ChatCompletionContentPartImage = object { image_url, type }

Learn about image inputs.

image_url: object { url, detail }
url: string
detail: optional "auto" or "low" or "high"
One of the following:
"auto"
"low"
"high"
type: "image_url"
ChatCompletionContentPartRefusal = object { refusal, type }
refusal: string
type: "refusal"
ChatCompletionContentPartText = object { text, type }

Learn about text inputs.

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

A call to a function tool created by the model.

id: string
function: object { arguments, name }

The function that the model called.

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

Learn about file inputs for text generation.

file: object { file_data, file_id, filename }
file_data: optional string
file_id: optional string
filename: optional string
type: "file"
Message = object { author, channel, content, 2 more }
author: object { role, name }
role: "user" or "assistant" or "system" or 2 more

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

One of the following:
"user"
"assistant"
"system"
"developer"
"tool"
name: optional string
channel: optional string
content: optional array of unknown
content_type: optional string
recipient: optional string