How much does an AI coding assistant cost via API for a small team?
A team sending 500 coding requests a day with 20,000 input and 1,500 output tokens pays about $590 a month at example $3/$15 prices with 80 % of input cached.
Last updated:
Cost per month
$589.50
- Cost per request
- $0.0393
- Cost per 1,000 requests
- $39.30
- Cost per year
- $7,074
- Tokens per month
- 322.5 M tokens
- Share from output tokens
- 57 %
Results are engineering estimates for planning. Final designs must follow your local code and be checked by a qualified professional.
This scenario at a glance
| Requests | 500 per day |
|---|---|
| Input tokens per request | 20,000 tokens |
| Output tokens per request | 1,500 tokens |
| Input price per 1M tokens | 3 $/1M |
| Output price per 1M tokens | 15 $/1M |
| Share of input served from cache | 80 % |
| Discount on cached input | 90 % |
| Batch API (50 % off) | No (real-time) |
| Cost per month | $589.50 |
|---|---|
| Cost per request | $0.0393 |
| Cost per 1,000 requests | $39.30 |
| Cost per year | $7,074 |
| Tokens per month | 322.5 M tokens |
| Share from output tokens | 57 % |
Engineering notes for this workload
Coding assistants send large contexts: open files, related modules, repository maps and conversation history. This scenario models a small team making 500 requests a day in total, each with 20,000 input tokens and 1,500 output tokens, and 80 % of the input served from the prompt cache because most of the repository context stays the same between requests.
At example prices of $3 per million input and $15 per million output tokens, with cached input billed at a 90 % discount, each request costs about $0.039 and the team spends about $590 a month. Without caching, the same usage would cost about $1,238 a month, so caching more than halves the bill for this kind of workload.
Output dominates once caching is in place: about 57 % of the cost here comes from the 1,500 output tokens per request. Asking for diffs or targeted edits instead of full file rewrites reduces output tokens and also makes the changes easier to review.
Agentic workflows change the math. When an assistant runs multi-step tasks, reading files, running tests and iterating, a single task can involve 10 to 50 model calls, each with large context. Measure cost per completed task rather than per request, and set budget limits per task or per user. Most providers let you set spending caps and alerts at the organization level.
Compare with seat-based subscriptions. Per-seat tools bundle a usage allowance at a fixed monthly price, which is easier to budget; API access is more flexible and can be cheaper for light users or more expensive for heavy agentic use. Many teams use both: subscriptions for day-to-day work and API keys for automation in CI pipelines.
Keep secrets out of prompts: exclude .env files and credentials from context, both for security and because every token sent is billed.
Review the usage dashboard weekly.
Reference table
| Workload | Input tokens | Output tokens | Notes |
|---|---|---|---|
| Chat turn with system prompt | 500–2,000 | 150–600 | History grows each turn |
| RAG answer | 3,000–10,000 | 300–800 | Retrieved chunks dominate |
| Document summary | 2,000–20,000 | 200–500 | Batch-friendly |
| Classification / tagging | 100–500 | 1–20 | Ideal for small models |
| Coding assistant | 10,000–50,000 | 500–3,000 | Large cached context |
| Agent tool step | 5,000–50,000 | 200–2,000 | Many steps per task |
Rule of thumb for English: 1 token ≈ 4 characters ≈ 0.75 words. Other languages and code usually need more tokens per word.
Questions about this scenario
How much does an AI coding assistant cost per request?
About $0.04 in this example with 20,000 input tokens, 1,500 output tokens and 80 % cached input.
Why is prompt caching important for coding assistants?
Repository context repeats across requests, so caching it can cut input cost by up to about 90 % for the cached part.
How do I control agentic AI costs?
Track cost per completed task, set per-task and organization budget limits, and prefer targeted edits over full rewrites.