Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/openai/resources/mod.ts>CompletionUsage

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Go to Latest
namespace CompletionUsage
import { CompletionUsage } from "https://deno.land/x/openai@v4.62.1/resources/mod.ts";

Interfaces

Breakdown of tokens used in a completion.

interface CompletionUsage
import { type CompletionUsage } from "https://deno.land/x/openai@v4.62.1/resources/mod.ts";

Usage statistics for the completion request.

Properties

completion_tokens: number

Number of tokens in the generated completion.

prompt_tokens: number

Number of tokens in the prompt.

total_tokens: number

Total number of tokens used in the request (prompt + completion).

optional
completion_tokens_details: CompletionUsage.CompletionTokensDetails

Breakdown of tokens used in a completion.