This guide calculates input token costs only.
Output token costs will vary based on the model used and the length of the generated response.To see the specific cost of each model (per 1M input and output tokens) applicable to your AssemblyAI account, refer to the Rates table on the Billing page of the dashboard.
Quickstart
- Python
- JavaScript
Step-by-Step Guide
Install dependencies
Install the required library:- Python
Set up your API key
Import the necessary libraries and set your AssemblyAI API key, which can be found on your account dashboard:- Python
- JavaScript
Transcribe your audio file
Transcribe your audio file using AssemblyAI:- Python
- JavaScript
Calculate character count
We’ll count the characters in both the transcript and your prompt:- Python
- JavaScript
Estimate tokens
Different LLM providers use different tokenization methods, but a rough estimate is that 4 characters equals approximately 1 token. This is based on guidance from:- Python
- JavaScript
Language considerationsToken counts can differ significantly across languages. Non-English languages
typically require more tokens per character than English. For instance, text
in languages like Spanish, Chinese, or Arabic may use 2-3 characters per token
instead of 4, resulting in higher token costs for the same amount of content.
Calculate input token costs
LLM Gateway’s pricing is calculated per 1M input tokens. Here are the current rates for popular models:- Python
- JavaScript
- GPT-5 (
gpt-5): ~$0.0015 - Claude Sonnet 4.6 (
claude-sonnet-4-6): ~$0.0037 - Gemini 2.5 Pro (
gemini-2.5-pro): ~$0.0015
These calculations estimate input token costs only. Output tokens are not included and will vary based on:
- The model you choose
- The complexity of your request
- The length of the generated response
Next steps
- LLM Gateway Overview - Learn about all available models and capabilities
- Apply LLM Gateway to Audio Transcripts - Complete guide to using LLM Gateway with transcripts
- Billing page - View LLM pricing for your account