Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Completions

Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position.

Create completion
client.Completions.New(ctx, body) (*Completion, error)
POST/completions
ModelsExpand Collapse
type Completion struct{…}

Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).

type CompletionChoice struct{…}
type CompletionUsage struct{…}

Usage statistics for the completion request.