AiPrice allows anyone using any HTTP client to calculate how much a prompt to the OpenAI API will cost and how many tokens are included. All models and types are supported and pricing is up to date.
As an author of an app that integrate with various AI models, this service caught my attention. I got a chance to review this API over the weekend, and in fact it has already helped me hone in on my overspending. So I can optimize my app's earnings by avoiding high-cost prompts and such. Props to the authors for writing up such a useful service.