Estimate tokens and cost for a text in any measured language
estimate_text_costEstimate token counts and input or output costs for text on a specified model; optionally set language and message count to calculate total cost.
Instructions
Estimate how many tokens a text takes on a model and what N such messages cost as input or output, using measured tokens-per-character for its language. Detects the script if language is omitted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| as | No | input | |
| text | Yes | ||
| model | Yes | ||
| language | No | ||
| messages | No | How many messages of this size |