Skip to content

CountTokensResponse

Source code in docs_src/capo_bedrock_runtime/types/count_tokens_response.py
class CountTokensResponse(TypedDict, closed=True):
    input_tokens: "int"
    """<p>The number of tokens in the provided input according to the specified model's tokenization rules. This count represents the number of input tokens that would be processed if the same input were sent to the model in an inference request. Use this value to estimate costs and ensure your inputs stay within model token limits.</p>"""

input_tokens instance-attribute

input_tokens: int

The number of tokens in the provided input according to the specified model's tokenization rules. This count represents the number of input tokens that would be processed if the same input were sent to the model in an inference request. Use this value to estimate costs and ensure your inputs stay within model token limits.