---
title: "Pick AI Models by Task to Save Cost: Completion, Review, Refactor"
description: "Choose an AI model by task to cut cost: split coding work into completion, review and refactor tiers with light, general and reasoning models, a worked cost example and a four-step routing checklist."
url: https://cdnping.org/en/blog/pick-model-by-task-to-save-cost
language: en
published: 2026-11-07
category: "Relays & gateways"
tags: ["model selection","cost control","model tiers","AI coding","AGI Plan"]
source: cdnping.org
license: Free to quote and summarize with a link to the url above.
---
# Pick AI Models by Task to Save Cost: Completion, Review, Refactor

The short version: sending every request to the strongest reasoning model is usually the most expensive way to work. Give completion, formatting and classification to a lightweight model, everyday coding and code review to a general-purpose model, and keep only complex refactors and long-running agent workflows for a reasoning model. Cost usually drops. Whether quality suffers is something you need to verify on your own samples. How much you save depends on your task mix, and the worked example below shows the arithmetic under stated assumptions.

This article covers how to pick a model by task to save money: how to tier tasks, what kind of model fits each tier, how to estimate cost, and how to check the result yourself.

## Why shouldn't every task use the same model?

Model price and latency generally rise with capability tier. An inline completion needs only a few hundred output tokens, and what matters is speed. A refactor across a dozen files needs long context and multi-step reasoning, and what matters is accuracy. Use one model for both and you get either slow, pricey completions or a refactor that falls short.

Token volume is the other factor. A completion may produce tens to hundreds of output tokens; a refactor may produce tens of thousands. Having many completions does not make them the biggest expense. Measured by usage, a few heavy tasks can account for most of the bill. So when tiering, look at unit price and volume together.

## How do you split coding tasks into three tiers?

Here is a common split. Adjust the boundaries to your own project.

| Tier | Typical tasks | What matters | Model type |
| --- | --- | --- | --- |
| Light | Inline completion, formatting, renaming, classification, field extraction, commit messages | Low latency, low unit price | Fast, lightweight |
| General | Everyday coding, single-file edits, code review, writing tests, explaining errors | Balanced quality and price | Balanced, general-purpose |
| Reasoning | Cross-file refactors, tracking down hard bugs, long-running agents, architecture design | Reasoning depth, long context | Frontier reasoning |

To decide which tier a task belongs in, ask three questions:

1. How costly is a mistake? Does someone review before merge? Tasks with a review safety net can go one tier lower.
2. How many files must the model understand at once? One or two files is usually the general tier; consider the reasoning tier at a dozen or so.
3. Can a machine verify the result? If tests or type checks can catch errors, try the cheaper model first and escalate only if it fails.

For more on choosing by task metrics, see "[How to choose an LLM: metrics by task for coding, translation, classification and long documents](/en/blog/choose-llm-by-task)".

## How much can you save? A worked example with assumptions

The numbers below are an illustration, not measurements, and do not represent any vendor's pricing. The assumptions:

- The output unit prices of the three tiers are in the ratio 1 : 5 : 25 (light : general : reasoning).
- One development day contains 200 completion requests, 20 review requests and 5 refactor requests.
- Output per request (in thousands of tokens) is 1, 5 and 30 respectively.

All on the reasoning tier: (200×1 + 20×5 + 5×30) × 25 = 450 × 25 = 11,250 units.

Tiered by task: 200×1×1 + 20×5×5 + 5×30×25 = 200 + 500 + 3,750 = 4,450 units.

Under these assumptions, cost falls to about 40% of the original, a saving of about 60%. Note that the refactor line makes up more than 80% of the tiered total. That is the "a few heavy tasks dominate" effect described earlier. If you change the ratio to 1 : 3 : 10, or have fewer refactors, the result changes. Plugging in your own usage is more useful than remembering this percentage.

For a fuller monthly estimate, see "[How much does AI coding cost per month: three tiers by development intensity](/en/blog/ai-coding-monthly-cost)".

## How do you put it into practice? Four steps to route tasks

1. Log for a week. Count requests and output tokens for each task type. Most API responses include a usage field; check the official docs of the API you use for the exact field name.
2. Assign a tier to each task type. Start with the table above, and put anything uncertain in the general tier.
3. Compare on samples. Pick 20 real samples per task type and run them on the two adjacent tiers. Compare by test pass rate or manual scoring. If the cheaper tier is not clearly worse, lock it in.
4. Set escalation rules. For example, "if a general-tier edit fails its tests, retry once on the reasoning tier automatically", so that not every failure goes straight to the most expensive model.

The hard part of manual routing is follow-through: switching models inside a tool is a hassle, and over time everyone sticks with the default. You can bind models to tools or configuration profiles, or route automatically through a gateway. For how that works and what to watch out for, see "[How to do multi-model routing: route by task to cut LLM cost without obvious quality loss](/en/blog/multi-model-routing-save-cost)".

## How do you keep spending from running away after routing?

Tiering lowers unit price, but runaway usage can still blow the budget. Do two things alongside it: create separate keys for different purposes so you can see usage per key, and set a budget cap with alerts. For specifics, see "[How to control API spending: budget caps, alerts and per-key breakdowns](/en/blog/control-ai-api-spending)".

## One way to automate routing: AGI Plan's four capability groups

If you would rather not switch models by hand in each tool, an aggregation gateway is one option. Take AGI Plan as an example (AGI Plan is a commercial partner of cdnping). It groups models into four capability groups that map directly onto the tiering above.

- Fast and lightweight (fast): completion, classification, formatting.
- Balanced general-purpose (balanced): everyday coding and code review.
- Domestic flagship (domestic): long Chinese-language text and batch jobs. Here "domestic" means flagship models from Chinese providers.
- Frontier reasoning (frontier): long-running agents and complex refactors.

Plans are monthly subscriptions, and one quota can be used across the capability groups. There is also a scheduling layer called Prism that routes requests to a suitable group based on task difficulty. Payment is in RMB with no overseas credit card needed. Tools such as Claude Code and Codex connect by changing a single endpoint URL; for the exact steps, follow the [AGI Plan getting-started page](https://agiplan.dev/startup).

A few things to know up front: AGI Plan states explicitly that it is not an officially authorized channel; some models are marked "overseas only", so check [agiplan.dev/models](https://agiplan.dev/models) for specifics; and plans differ only in quota. To choose a tier, see "[How to choose among AGI Plan's four plans: Lite, Plus, Pro, Max compared](/en/blog/agiplan-plans-lite-plus-pro-max)". Before you buy, run through "[Is a third-party AI gateway reliable? Eight checks before you buy](/en/blog/evaluate-third-party-ai-api-gateway)" yourself.

Automatic routing is not a cure-all either. It judges by difficulty, which may not match the particulars of your project, so the "compare on samples" step above is still worth doing.

## Which tools show data before you pick a model?

- To see availability, latency and quantization precision of models across inference providers, use cdnping's [model monitoring](/en/models).
- To check whether an official endpoint is currently up, see [API status](/en/status).
- To measure first-connection and round-trip latency to each endpoint from mainland China, use the [online speed test](/en) on the home page. For how it works, see "[AI API latency from mainland China](/en/learn/ai-api-latency-china)".

## Next step

Don't swap tools yet. Keep records for a week using the four steps above: count requests and output volume per task type, then plug your own numbers into the example. If refactors and long tasks make up most of your cost, focus on how often you use the reasoning tier. If completions dominate, moving them to the light tier pays off most. If you want a ready-made routing setup, then look at AGI Plan's [getting-started page](https://agiplan.dev/startup).
