Interface CreateChatCompletionResponse

The response body for a Create Chat Completion request.

Hierarchy

  • CreateChatCompletionResponse

Properties

choices: [{
    finish_reason: string;
    index: number;
    message: CreateChatCompletionMessage | CreateChatCompletionFunctionCallMessage | CreateChatCompletionFunctionMessage;
}]

The chat completion choices generated by the model. Always contains exactly one choice.

Type declaration

created: number

The time the chat completion was created, in Unix time.

id: string

A unique identifier for the chat completion.

model: string

The model used to generate the chat completion.

object: string

The object type, which is always chat_completion.

usage: {
    completion_tokens: number;
    prompt_tokens: number;
    total_tokens: number;
}

The usage incurred by the chat completion.

Type declaration

  • completion_tokens: number

    The number of tokens used for the completion.

  • prompt_tokens: number

    The number of tokens used for the prompt.

  • total_tokens: number

    The sum of the prompt and completion tokens.

Generated using TypeDoc