Skip to main content
Module

x/openai/resources/completions.ts>Completion

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Go to Latest
interface Completion
import { type Completion } from "https://deno.land/x/openai@v4.21.0/resources/completions.ts";

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

Properties

id: string

A unique identifier for the completion.

choices: Array<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.

model: string

The model used for completion.

object: "text_completion"

The object type, which is always "text_completion"

optional
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.

optional
usage: CompletionUsage

Usage statistics for the completion request.