Understanding the cost of AI assistants
You’re building an internal tool that uses an AI model to generate unit tests. You’re evaluating two models, Model A and Model B, and you know the following:
- Both models have identical per-token pricing.
- For each request, both models use about the same number of input tokens and the same number of output tokens to produce the test itself.
- Model B also emits an extra 1,500 “reasoning” tokens per request that are billed but do not improve test quality.
Given the cost per token for each model, which one, A or B, is the most cost-effective solution?
This exercise is part of the course
AI-Assisted Coding for Developers
Hands-on interactive exercise
Turn theory into action with one of our interactive exercises
 Start Exercise
Start Exercise