by binarymax · 1y ago · 0 comments
Here's the current version:
const pricesPerMillion = {
"o1-2024-12-17": { input: 15.00, output: 60.00 },
"o1-mini-2024-09-12": { input: 1.10, output: 4.40 },
"o3-mini-2025-01-31": { input: 1.10, output: 4.40 },
"gpt-4.5-preview-2025-02-27": { input: 75.00, output: 150.00 },
"gpt-4o": { input: 5.00, output: 15.00 },
"gpt-4o-2024-08-06": { input: 2.50, output: 10.00 },
"gpt-4o-2024-05-13": { input: 5.00, output: 15.00 },
"gpt-4o-mini": { input: 0.15, output: 0.60 },
"gpt-4o-mini-2024-07-18": { input: 0.15, output: 0.60 },
"gpt-4-0613": { input: 30.00, output: 60.00 },
"gpt-4-turbo-2024-04-09": { input: 10.00, output: 30.00 },
"gpt-3.5-turbo": { input: 0.003, output: 0.006 },
"gpt-4.1": { input: 2.00, output: 8.00 },
"gpt-4.1-2025-04-14": { input: 2.00, output: 8.00 },
"gpt-4.1-mini": { input: 0.40, output: 1.60 },
"gpt-4.1-mini-2025-04-14": { input: 0.40, output: 1.60 },
"gpt-4.1-nano": { input: 0.10, output: 0.40 },
"gpt-4.1-nano-2025-04-14": { input: 0.10, output: 0.40 },
"gpt-4o-audio-preview-2024-12-17": { input: 2.50, output: 10.00 },
"gpt-4o-realtime-preview-2024-12-17": { input: 5.00, output: 20.00 },
"gpt-4o-mini-audio-preview-2024-12-17": { input: 0.15, output: 0.60 },
"gpt-4o-mini-realtime-preview-2024-12-17": { input: 0.60, output: 2.40 },
"o1-pro-2025-03-19": { input: 150.00, output: 600.00 },
"o3-pro-2025-06-10": { input: 20.00, output: 80.00 },
"o3-2025-04-16": { input: 2.00, output: 8.00 },
"o4-mini-2025-04-16": { input: 1.10, output: 4.40 },
"codex-mini-latest": { input: 1.50, output: 6.00 },
"gpt-4o-mini-search-preview-2025-03-11": { input: 0.15, output: 0.60 },
"gpt-4o-search-preview-2025-03-11": { input: 2.50, output: 10.00 },
"computer-use-preview-2025-03-11": { input: 3.00, output: 12.00 }
};
I would love to replace this with an API call.1. Pull some large tech company’s open source’ tools’ JS file 2. Extract an internal JSON blob that contains otherwise difficult information 3. Parse it and use what I need from within it for my tool