Search hosts for the model
Start with a broad search to discover provider-specific identifiers. This request can return both exact matches and related variants, so do not rank every row together.meta.total_pages. Keep the model_id and provider_id from every candidate you intend to compare. A model developer, direct provider, and gateway can be different parties; the provider in your estimate must match the route you will use.
Filter to exact matches
Exactmodel_id matching is a useful first filter because it excludes similarly named smaller models and dated variants. It is not proof that two deployments have identical settings or behavior. Conversely, providers can use different prefixes for the same underlying model. Include those entries only after checking the provider’s model documentation, version, and deployment characteristics.
Exclude rows with pricing: null from numeric rankings. Keep them marked as unavailable rather than treating them as free. If you require a specific context length, output format, or region, check those requirements before doing a price-only comparison.
Compare the input and output mix
For an ordinary text request without additional charges, calculateinput_tokens × pricing.prompt + output_tokens × pricing.completion. The rates are USD per token. The following invented rates show why sorting only by input price gives the wrong answer for some workloads. Both scenarios use 1,000 input tokens; the short answer uses 100 output tokens and the long answer uses 2,000. Host A charges 8 for output per million tokens. Host B charges 3 respectively. The table shows USD per request.
Host A wins for the short answer, while host B wins for the long answer. For these rates, the break-even point is 200 output tokens per 1,000 input tokens. Use a representative distribution of your requests if output lengths vary substantially; one unusually short example can reverse the apparent ranking.
Price a request on each host
Send each candidate pair and the same usage counts to the cost endpoint. Comparecost_breakdown.total only for successful responses. Include actual cache usage when applicable, and confirm that your estimate covers any request or search charges. Save the input counts and lookup time with the ranking so another reader can reproduce its assumptions.
Before switching, run a small workload through the chosen route. Check actual token usage, latency, error rates, and output quality. Account-specific discounts or routing choices can change the price you pay. The result of this guide is the lowest catalog cost among the eligible hosts you evaluated, for the usage you supplied—not a universal cheapest-provider claim.
If changing hosts also changes the model, use the two-stage model comparison before treating the estimate as a production saving.