Type alias CreateCompletionResponse

CreateCompletionResponse: {
    choices: {
        finish_reason: "stop" | "length" | "content_filter";
        index: number;
        logprobs: {
            text_offset?: number[];
            token_logprobs?: number[];
            tokens?: string[];
            top_logprobs?: Record<string, number>[];
        } | null;
        text: string;
    }[];
    created: number;
    id: string;
    model: string;
    object: string;
    usage?: CompletionUsage;
}

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 declaration

  • choices: {
        finish_reason: "stop" | "length" | "content_filter";
        index: number;
        logprobs: {
            text_offset?: number[];
            token_logprobs?: number[];
            tokens?: string[];
            top_logprobs?: Record<string, number>[];
        } | null;
        text: string;
    }[]

    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: string

    The object type, which is always "text_completion"

  • Optional usage?: CompletionUsage

Generated using TypeDoc