You have a task, say classifying support tickets or answering questions over retrieved passages, and there are 375 priced chat models to choose from. Reading a price table by hand does not scale, and the cheapest model overall may not fit your prompt. This post gives you a 40-line script that filters the catalog by what your task needs and ranks what is left by estimated cost in rupees.
Disclosure: AICredits links on this site are affiliate links. The script reads AICredits' public catalog, fetched on 2026-10-16, and needs no account. Price is not quality. Nothing here says any model is good at your task; the script produces a shortlist to test.
What does the script need to know about your task?
Four numbers and two filters:
- Input tokens and output tokens for a typical call, from your own logs if you have them.
- Cached share of the input, if your prompts repeat a long prefix and the model has a cached price.
- Minimum context, and the script also requires the window to hold input plus output.
- API:
chat_completionsby default, orresponsesif your code uses that API (see Responses vs Chat Completions). - Optionally a text match on the model ID, to restrict to one family.
def cost(m, tin, tout, cached_share):
pin = m["input_cost_per_token_inr"]
pc = m.get("cached_input_cost_per_token_inr") or pin
return tin * ((1 - cached_share) * pin + cached_share * pc) + tout * m["output_cost_per_token_inr"]
def pick(models, tin, tout, min_ctx=0, api="chat_completions", cached_share=0.0, match=None, top=8):
rows = []
for m in models:
if m.get("mode") != "chat" or not m.get("is_active"):
continue
if api not in m.get("supported_apis", []):
continue
if (m.get("context_length") or 0) < max(min_ctx, tin + tout):
continue # prompt + answer must fit in the window
if not m.get("input_cost_per_token_inr") or not m.get("output_cost_per_token_inr"):
continue # no usable price
if match and match.lower() not in m["id"].lower():
continue
rows.append((cost(m, tin, tout, cached_share), m))
rows.sort(key=lambda r: r[0])
return rows[:top], len(rows)
What does it produce for three typical tasks?
All runs on the 2026-10-16 snapshot, prices in rupees.
A short classification call (500 in, 20 out): 375 models qualified.
mistralai/mistral-nemo Rs 0.0011/task Rs 1.06/1000 ctx 131072
ibm-granite/granite-4.0-h-micro Rs 0.0011/task Rs 1.07/1000 ctx 131000
nex-agi/nex-n2.5-mini Rs 0.0014/task Rs 1.45/1000 ctx 262144
upstage/solar-pro4 Rs 0.0017/task Rs 1.74/1000 ctx 524288
meta-llama/llama-3.2-1b-instruct Rs 0.0017/task Rs 1.75/1000 ctx 60000
A retrieval answer (6,000 in, 400 out, at least 128k context): 298 models qualified.
mistralai/mistral-nemo Rs 0.0132/task Rs 13.18/1000 ctx 131072
ibm-granite/granite-4.0-h-micro Rs 0.0147/task Rs 14.66/1000 ctx 131000
nex-agi/nex-n2.5-mini Rs 0.0190/task Rs 18.97/1000 ctx 262144
upstage/solar-pro4 Rs 0.0228/task Rs 22.77/1000 ctx 524288
inference-net/schematron-v2-turbo Rs 0.0240/task Rs 23.97/1000 ctx 128000
A long-document summary (100,000 in, 1,500 out, at least 200k context): 226 models qualified.
nex-agi/nex-n2.5-mini Rs 0.2646/task Rs 264.62/1000 ctx 262144
upstage/solar-pro4 Rs 0.3175/task Rs 317.54/1000 ctx 524288
qwen/qwen3.7-flash Rs 0.4204/task Rs 420.39/1000 ctx 1000000
inception/mercury-2.5 Rs 0.4219/task Rs 421.89/1000 ctx 260000
inclusionai/ling-3.0-flash-sante Rs 0.4378/task Rs 437.84/1000 ctx 262144
I checked the first line by hand: 500 input tokens at Rs 2.00 per million is Rs 0.00100, plus 20 output tokens at Rs 3.00 per million is Rs 0.00006, total Rs 0.00106, matching the 0.0011 shown.
What does this ranking not tell you?
- Quality. The same list ranks a 1-billion-parameter model next to much larger ones. For some tasks (tag classification) a small model is enough; for others (legal summarisation) it is not. Test.
- Attempts per success. If the cheapest model needs three tries to get a valid result and the next one needs one, the second is cheaper per success.
- Long-context behaviour. A listed window is a ceiling. Quality on very long inputs differs by model; see long-context prompting.
- Output length. The script uses your assumed output tokens. Models that think out loud or write long answers cost more than the estimate. Reasoning tokens may be billed as output; check your provider's usage fields.
- Data errors. The catalog is one vendor's feed. Look at the
gpt-5-nanorows from theresponsesrun:
gpt-5-nano Rs 0.0459/task Rs 45.93/1000 ctx 8192
openai/gpt-5-nano Rs 0.0459/task Rs 45.93/1000 ctx 400000
The bare ID lists a context of 8,192 tokens and the prefixed one 400,000. They cannot both be right, and the script cannot tell which. That is why the context filter is a first pass, and why you confirm the window in the provider's docs before you depend on it.
What should you do with the shortlist?
- Take the top 5 to 8, plus one or two models you already trust as a baseline.
- Build a small evaluation set of 30 to 100 real examples with known good answers. Building evaluation datasets shows how.
- Run each candidate through the same prompts, using the conformance test first to confirm streaming and tool calls work for that model.
- Compute cost per successful task, using the usage-log cost script.
- Re-run the ranking when prices change; the price tracker tells you when.
Fetch the catalog with curl -s https://api.aicredits.in/v1/models -o models.json. For a different angle on the same data, read the catalog analysis. If you want to try candidates with UPI payment, the AICredits signup is an affiliate link.
What I could not verify
- Quality, speed or reliability of any listed model.
- The accuracy of every context length and price in the catalog.
- Whether wallet charges equal the catalog INR price.



