Cheapest-model query: returns the lowest-cost AI models matching your constraints — min_co
Cheapest-model query: returns the lowest-cost AI models matching your constraints — min_context (tokens), vision/function_calling/reasoning (true), max_input_per_mtok (USD cap), limit (default 5). Add expected_input/expected_output token counts to rank by blended USD per request instead of input price; exclude_preview=true skips pre-release models. Answers 'what is the cheapest model that can do X?' across 2,000+ models and 70+ providers.
5000 (raw units)
price
2
calls / 30d
2
unique payers
2026-08-28
updated
Provider
modelprices.xyz · discovered, not yet claimed by its owner
Payment (x402 accepts[])
[
{
"scheme": "exact",
"network": "eip155:8453",
"payTo": "0x63a20fa244d3E6a8902121E99704b7F857dc6EBB",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "5000",
"maxTimeoutSeconds": 300
}
]Output schema
{
"bazaar": {
"info": {
"input": {
"method": "GET",
"queryParams": {
"expected_input": 2000,
"expected_output": 500,
"limit": 3,
"min_context": 200000,
"vision": true
},
"type": "http"
},
"output": {
"example": {
"generated_at": "2026-07-14T02:00:00.000Z",
"match_count": 41,
"models": [
{
"cache_read_per_mtok": 0.3,
"confidence": "high",
"first_observed_at": "2026-07-12T18:00:00.000Z",
"id": "claude-sonnet-5",
"input_per_mtok": 3,
"output_per_mtok": 15,
"provider": "anthropic",
"source_url": "https://docs.claude.com/en/docs/about-claude/pricing",
"usd_per_request": 0.0135
}
],
"ranked_by": "usd_per_request"
},
"type": "json"
}
},
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"input": {
"additionalProperties": false,
"properties": {
"method": {
"enum": [
"GET"
],
"type": "string"
},
"queryParams": {
"properties": {
"exclude_preview": {
"description": "Exclude preview/pre-release model versions",
"type": "boolean"
},
"expected_input": {
"description": "Expected input tokens per request — with expected_output, ranks by blended USD per request instead of input price",
"type": "number"
},
"expected_output": {
"description": "Expected output tokens per request",
"type": "number"
},
"function_calling": {
"type": "boolean"
},
"limit": {
"default": 5,
"maximum": 25,
"type": "integer"
},
"max_input_per_mtok": {
"description": "Max input price in USD per 1M tokens",
"type": "number"
},
"min_context": {
"description": "Minimum context window in tokens",
"type": "integer"
},
"reasoning": {
"type": "boolean"
},
"vision": {
"type": "boolean"
}
},
"type": "object"
},
"type": {
"const": "http",
"type": "string"
}
},
"required": [
"type",
"method"
],
"type": "object"
},
"output": {
"properties": {
"example": {
"type": "object"
},
"type": {
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
},
"required": [
"input"
],
"type": "object"
}
},
"builder-code": {
"info": {
"a": "modelprices"
},
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"a": {
"description": "App builder code",
"pattern": "^[a-z0-9_]{1,32}$",
"type": "string"
},
"s": {
"description": "Service builder codes",
"items": {
"pattern": "^[a-z0-9_]{1,32}$",
"type": "string"
},
"type": "array"
},
"w": {
"description": "Wallet builder code",
"pattern": "^[a-z0-9_]{1,32}$",
"type": "string"
}
},
"type": "object"
}
}
}Use it
curl
curl "https://modelprices.xyz/llm/cheapest" # -> 402 Payment Required, accepts[] lists how to pay # retry with a PAYMENT-SIGNATURE (or PAYMENT header) once paid
JavaScript
const res = await fetch("https://modelprices.xyz/llm/cheapest");
if (res.status === 402) {
const { accepts } = await res.json();
// pay one of accepts[] via an x402 client, then retry with the payment header
}Python
import httpx
res = httpx.get("https://modelprices.xyz/llm/cheapest")
if res.status_code == 402:
accepts = res.json()["accepts"]
# pay one of accepts[] via an x402 client, then retry with the payment headerMachine-readable
Everything on this page is also available as clean JSON at /resources/10896.json, and this resource appears in /discovery/resources and /discovery/search.