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

interface Completion {
    choices: CompletionChoice[];
    created: number;
    id: string;
    model: string;
    object: "text_completion";
    system_fingerprint?: string;
    usage?: CompletionUsage;
}

Properties

choices: CompletionChoice[]

The list of completion choices the model generated for the input prompt.

created: number

The Unix timestamp (in seconds) of when the completion was created.

id: string

A unique identifier for the completion.

model: string

The model used for completion.

object: "text_completion"

The object type, which is always "text_completion"

system_fingerprint?: string

This fingerprint represents the backend configuration that the model runs with.

Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism.

Usage statistics for the completion request.