InputTokens Property  
 

Returns the number of tokens used by the most recent prompt.

Syntax

object.InputTokens

Remarks

The InputTokens property returns the number of input tokens used by the most recent prompt sent to the model. This value reflects the number of tokens consumed by the prompt and any associated context included with the request.

Token counts are determined by the model provider and may vary depending on the content of the prompt, the model being used and how the provider processes the request. Token counts do not directly correspond to characters or words, and the same text may produce different token counts when used with different models.

If no prompt has been sent, or if the request failed before the provider returned token usage information, this property will return zero.

Data Type

Integer (Int32)

See Also

OutputTokens Property, TotalTokens Property, EstimateTokens Method, SendMessage Method