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
completions.create(CompletionCreateParams**kwargs) -> Completion
POST/completions
ModelsExpand Collapse
class Completion:

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

class CompletionChoice:
class CompletionUsage:

Usage statistics for the completion request.