# LLMoney > LLM Token Cost Calculator & Model Pricing API. > Compare pricing for 66 AI models from OpenAI, Anthropic, Google, DeepSeek, Meta, Mistral AI, xAI, Cohere, GigaChat (Cloud.ru), Yandex AI Studio. ## API Base URL https://api.llmoney.ru/api/v1 All endpoints return JSON. No authentication required for read-only endpoints. ## Endpoints ### GET /api/v1/models List all supported LLM models with current pricing. Query parameters: - provider (string, optional): Filter by provider slug (see Providers section) - free_only (boolean, optional): Only show models with free (local) tokenization. Default: false Example request: GET https://api.llmoney.ru/api/v1/models?provider=openai Example response: { "models": [ { "id": "openai-gpt-4o", "provider": "openai", "provider_display_name": "OpenAI", "name": "gpt-4o", "display_name": "GPT-4o", "tokenizer_type": "tiktoken", "input_price": 2.50, "output_price": 10.00, "cached_input_price": 1.25, "currency": "usd", "context_window": 128000, "description": null } ] } Prices are per 1,000,000 tokens. Currency is "usd" or "rub". ### GET /api/v1/models/{model_id} Get details for a specific model including current pricing. Example request: GET https://api.llmoney.ru/api/v1/models/openai-gpt-4o Example response: { "id": "openai-gpt-4o", "provider": "openai", "provider_display_name": "OpenAI", "name": "gpt-4o", "display_name": "GPT-4o", "tokenizer_type": "tiktoken", "tokenizer_config": {"encoding": "o200k_base"}, "input_price": 2.50, "output_price": 10.00, "cached_input_price": 1.25, "currency": "usd", "is_paid_api": false, "supports_byok": true, "context_window": 128000, "description": null } ### GET /api/v1/models/{model_id}/price-history Get historical pricing data for a model, sorted chronologically. Example request: GET https://api.llmoney.ru/api/v1/models/openai-gpt-4o/price-history Example response: { "model_id": "openai-gpt-4o", "entries": [ { "date": "2025-01-01", "input_price": 2.50, "output_price": 10.00, "cached_input_price": 1.25, "source": "seed" } ] } ### GET /api/v1/recommend AI-agent-friendly endpoint for selecting optimal models by budget and constraints. Returns a simplified, sorted list without tokenizer details. Query parameters: - max_input_price (float, optional): Maximum price per 1M input tokens - max_output_price (float, optional): Maximum price per 1M output tokens - min_context_window (integer, optional): Minimum context window size in tokens - currency (string, optional): Filter by currency — "usd" or "rub" - provider (string, optional): Filter by provider slug - sort_by (string, optional): Sort criterion — "input_price" (default), "output_price", "context_window" - limit (integer, optional): Maximum number of results, 1-100. Default: 10 Example request: GET https://api.llmoney.ru/api/v1/recommend?max_input_price=5¤cy=usd&sort_by=input_price&limit=5 Example response: { "models": [ { "id": "openai-gpt-4o-mini", "provider": "openai", "name": "gpt-4o-mini", "display_name": "GPT-4o Mini", "input_price": 0.15, "output_price": 0.60, "cached_input_price": 0.075, "currency": "usd", "context_window": 128000 } ], "total_available": 42, "filters_applied": { "max_input_price": 5, "currency": "usd", "sort_by": "input_price", "limit": 5 } } ### POST /api/v1/calculate Calculate token counts and costs for a given text across models, including prompt-cache discounts and tool-use token overhead. Request body (JSON): { "text": "Your text to analyze", "model_ids": ["openai-gpt-4o"], "output_multiplier": 1.0, "cached_input_ratio": 0.0, "tools": [ {"type": "function", "count": 3, "calls": 2} ] } - text (string, required): The text to tokenize and price - model_ids (array of strings, optional): Restrict calculation to these models. Default: all models with free local tokenization - output_multiplier (float, optional): Multiplier for estimated output tokens. Default: 1.0 - cached_input_ratio (float, optional): Share of input tokens served from the prompt cache, 0..1. Models with a cached_input_price get a blended input cost. Default: 0.0 - tools (array, optional): Tool-use token overhead estimation. Each item: - type (string, required): "code_interpreter" | "web_search" | "file_search" | "mcp" | "function" - count (integer, optional): Number of tools of this type defined. Default: 1 - calls (integer, optional): Invocations per request. Default: 1 - def_tokens / call_tokens / result_tokens (integer, optional): Override the built-in per-definition / per-call / per-result token estimates Example request: POST https://api.llmoney.ru/api/v1/calculate Content-Type: application/json {"text": "Hello, how much does this cost?", "output_multiplier": 1} Example response: { "input_length": 31, "word_count": 6, "results": [ { "model_id": "openai-gpt-4o", "provider": "openai", "model_name": "gpt-4o", "display_name": "GPT-4o", "tokens": 8, "cached_tokens": 0, "input_cost": 0.00002, "cached_input_cost": 0.0, "output_cost": 0.00008, "tool_input_tokens": 0, "tool_output_tokens": 0, "tool_cost": 0.0, "total_cost": 0.0001, "currency": "usd", "tokenizer_used": "o200k_base", "is_available": true } ] } ### POST /api/v1/tokenize Tokenize text using a specific model's tokenizer. Returns individual token IDs. Request body (JSON): { "text": "Text to tokenize", "model_id": "openai-gpt-4o" } ### GET /api/v1/exchange-rate Current USD to RUB exchange rate (Central Bank of Russia, cached server-side). ## Pricing Format - All prices are per 1,000,000 (one million) tokens - currency field is "usd" (US dollars) or "rub" (Russian rubles) - input_price: cost per 1M input/prompt tokens - output_price: cost per 1M output/completion tokens - cached_input_price: discounted rate for cached input tokens (if available) - Prices refresh automatically every day from provider sources; history is available via /price-history ## Providers Available provider slugs: anthropic, cohere, deepseek, gigachat, google, meta, mistral, openai, xai, yandex ## OpenAPI Specification Full machine-readable OpenAPI 3.1 spec: https://api.llmoney.ru/api/v1/openapi.json Interactive Swagger UI documentation: https://api.llmoney.ru/api/docs ReDoc documentation: https://api.llmoney.ru/api/redoc