Skip to main content

openai.createcompletionprops.maxtokens

Home > @runlightyear/openai > CreateCompletionProps > maxTokens

CreateCompletionProps.maxTokens property

Defaults to 16 The maximum number of tokens to generate in the completion.

The token count of your prompt plus maxTokens cannot exceed the model's context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096).

Signature:
maxTokens?: number;