estimate_tokens
Estimate token count for any text string using per-model calibrated character-to-token ratios.
Instructions
Estimate token count for a text string. Uses calibrated chars/token ratios per model. Example: estimate_tokens(text='Hello world', model='gpt-4o') → {tokens: 2, ...}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| model | No | gpt-4o |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||