Free LLM Pricing API

Every model and price on this site is published as an openly-licensed dataset. No API key, no rate limit, no signup. Use it in your app, your spreadsheet, your blog post, your research paper. Licensed under CC BY 4.0 — just link back to llmcalculator.net.

Endpoints

PathFormatReturns
GET /api/v1/modelsJSONAll current models (filters: ?provider=, ?max_input=, ?speed=)
GET /api/v1/models/:idJSONA single model by id, e.g. gpt-4o
POST /api/v1/calculateJSONBody: { model_id, input_tokens, output_tokens } → cost breakdown
GET /api/v1/providersJSONAll providers with model counts
GET /api/v1/cheapestJSONCheapest models (?sort=input|output|combined, ?limit=, ?provider=)
POST /mcpJSON-RPCModel Context Protocol server for AI assistants
/llm-pricing-historyHTML / dataHistorical pricing 2023–2026 (citable dataset)

CORS is open (Access-Control-Allow-Origin: *) so you can fetch from the browser.

Sample response

GET /api/v1/models

{
  "updated": "2026-06-25",
  "currency": "USD",
  "unit": "per_1m_tokens",
  "models": [
    {
      "id": "gpt-5.5",
      "provider": "openai",
      "name": "GPT-5.5",
      "input": 1.25,
      "output": 10,
      "context": 400000
    },
    {
      "id": "claude-sonnet-4-6",
      "provider": "anthropic",
      "name": "Claude Sonnet 4.6",
      "input": 3,
      "output": 15,
      "context": 1000000
    },
    {
      "id": "gemini-3-1-pro",
      "provider": "google",
      "name": "Gemini 3.1 Pro",
      "input": 1.25,
      "output": 10,
      "context": 2000000
    },
    {
      "id": "deepseek-v4-flash",
      "provider": "deepseek",
      "name": "DeepSeek V4 Flash",
      "input": 0.07,
      "output": 0.27,
      "context": 128000
    }
  ]
}

Quick examples

cURL
curl https://llmcalculator.net/api/v1/models
curl -X POST https://llmcalculator.net/api/v1/calculate \
  -H "content-type: application/json" \
  -d '{"model_id":"gpt-4o","input_tokens":50000,"output_tokens":10000}'
JavaScript
const r = await fetch("https://llmcalculator.net/api/v1/cheapest?limit=5");
const { models } = await r.json();
console.log(models[0]);
Python
import requests
r = requests.post("https://llmcalculator.net/api/v1/calculate", json={
  "model_id": "claude-sonnet-4-6",
  "input_tokens": 50000,
  "output_tokens": 10000,
})
print(r.json()["total_cost_usd"])

MCP server for AI assistants

Claude, ChatGPT, Cursor and any other Model Context Protocol client can connect to our hosted MCP server and use the LLM pricing tools directly inside the chat.

Endpoint
https://llmcalculator.net/mcp
Transport
Streamable HTTP (JSON-RPC 2.0 over POST). No auth required.
Available tools
  • list_models — list models, filter by provider/price
  • calculate_cost — compute cost for a model + token counts
  • compare_models — rank all models by total cost for a workload
  • get_cheapest_model — single cheapest model (optional provider filter)
Claude Desktop / Cursor config
{
  "mcpServers": {
    "llmcalculator": {
      "url": "https://llmcalculator.net/mcp"
    }
  }
}

Attribution

If you use this data, please credit:

Source: LLMCalculator.net — https://llmcalculator.net (CC BY 4.0)