Actions

Pricing Notes

  • Input Price: Cost per million input tokens (prompt tokens)
  • Output Price: Cost per million output tokens (completion tokens)
  • Batch Pricing: Reduced rates for asynchronous batch processing where available
  • Tiered Pricing: Some models have volume-based pricing tiers (shown as ranges)
  • Currency: All prices in USD unless otherwise noted
  • Updates: Prices accurate as of the data source date. Always verify with the official provider pricing page before production use.
bVal = b.displayName; break; case 'tokenizer': aVal = a.tokenizer; bVal = b.tokenizer; break; case 'input': aVal = a.inputPrice ?? Infinity; bVal = b.inputPrice ?? Infinity; return (aVal - bVal) * multiplier; case 'output': aVal = a.outputPrice ?? Infinity; bVal = b.outputPrice ?? Infinity; return (aVal - bVal) * multiplier; case 'batch': aVal = a.hasBatch ? 1 : 0; bVal = b.hasBatch ? 1 : 0; return (bVal - aVal) * multiplier; default: return 0; } if (typeof aVal === 'string') { return aVal.localeCompare(bVal) * multiplier; } return 0; }); } function updateSortIcons() { document.querySelectorAll('.sort-btn').forEach(btn => { const icon = btn.querySelector('.sort-icon'); if (btn.dataset.sort === currentSort.column) { icon.textContent = currentSort.direction === 'asc' ? '↑' : '↓'; btn.setAttribute('aria-pressed', 'true'); } else { icon.textContent = '↕'; btn.setAttribute('aria-pressed', 'false'); } }); } function renderTable() { const tbody = document.getElementById('pricing-table-body'); if (filteredModels.length === 0) { tbody.innerHTML = 'No models match your filters'; return; } tbody.innerHTML = filteredModels.map(model => { const inputPriceDisplay = formatPriceDisplay(model, 'input'); const outputPriceDisplay = formatPriceDisplay(model, 'output'); const batchDisplay = model.hasBatch ? 'Available' : 'No'; return ` ${escapeHtml(model.providerName)} ${escapeHtml(model.displayName)} ${escapeHtml(model.tokenizer)} ${inputPriceDisplay} ${outputPriceDisplay} ${batchDisplay} Calculate `; }).join(''); } function formatPriceDisplay(model, type) { const price = type === 'input' ? model.inputPrice : model.outputPrice; if (price === null) { return 'N/A'; } // Check if model has tiered pricing if (model.pricing_tiers && model.pricing_tiers.length > 1) { const priceKey = type === 'input' ? 'input_price_per_mtok' : 'output_price_per_mtok'; const firstTierPrice = model.pricing_tiers[0][priceKey]; const lastTierPrice = model.pricing_tiers[model.pricing_tiers.length - 1][priceKey]; if (firstTierPrice !== lastTierPrice) { return `${formatPrice(firstTierPrice)}–${formatPrice(lastTierPrice)} (tiered)`; } } return formatPrice(price); } function escapeHtml(text) { const div = document.createElement('div'); div.textContent = text; return div.innerHTML; }