Chat

chat

Domain types

ChatModel = "o1-preview" | "o1-preview-2024-09-12" | "o1-mini" | 30 more...
Chat

Completions

chat.completions

Methods

Create Chat Completion ->
post/chat/completions

Creates a model response for the given chat conversation. Learn more in the text generation, vision, and audio guides.

Domain types

ChatCompletion = { id, choices, created, 5 more... }
ChatCompletionAssistantMessageParam = { role, audio, content, 4 more... }
ChatCompletionAudio = { id, data, expires_at, 1 more... }
ChatCompletionAudioParam = { format, voice }
ChatCompletionChunk = { id, choices, created, 5 more... }
ChatCompletionContentPartImage = { image_url, type }
ChatCompletionContentPartInputAudio = { input_audio, type }
ChatCompletionContentPartRefusal = { refusal, type }
ChatCompletionContentPartText = { text, type }
ChatCompletionFunctionCallOption = { name }
ChatCompletionFunctionMessageParam = { content, name, role }
ChatCompletionMessage = { content, refusal, role, 3 more... }
ChatCompletionMessageToolCall = { id, function, type }
ChatCompletionModality = "text" | "audio"
ChatCompletionNamedToolChoice = { function, type }
ChatCompletionPredictionContent = { content, type }
ChatCompletionRole = "system" | "user" | "assistant" | 2 more...
ChatCompletionStreamOptions = { include_usage }
ChatCompletionSystemMessageParam = { content, role, name }
ChatCompletionTokenLogprob = { token, bytes, logprob, 1 more... }
ChatCompletionTool = { function, type }
ChatCompletionToolChoiceOption = "none" | "auto" | "required" |
ChatCompletionToolMessageParam = { content, role, tool_call_id }
ChatCompletionUserMessageParam = { content, role, name }