Call our REST API, pass in your model, and instantly know what your request costs. Compatible with ChatGPT, Gemini, and soon every major LLM.
POST https://llm-cost-calculator.pages.dev/api/how-much
Content-Type: application/json
{
"vendor": "openai",
"model": "gpt-4.1",
"specs": {
"tier": "Standard"
},
"tokens": {
"input": 123000,
"output": 456000
}
} …and you’ll instantly get the cost in dollars.
{
"inputCost": 0.00246,
"outputCost": 0.036480000000000005,
"totalCost": 0.03894
}Currently only text-based LLMs are supported.
| Vendor | Models | Values for specs |
|---|---|---|
| openai | gpt-5, gpt-5-mini, gpt-5-nano, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, gpt-4o, gpt-4o-2024-05-13, gpt-4o-mini, o1, o1-pro, o3-pro, o3, o3-deep-research, o4-mini, o4-mini-deep-research, o3-mini, o1-mini, computer-use-preview, gpt-3.5-turbo-0125 | {
tier: 'Batch' | 'Flex' | 'Standard' | 'Priority';
cachedInput: boolean | false;
} |